import FWCore.ParameterSet.Config as cms process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger = cms.Service("MLlog4cplus") process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring ( 'detailedInfo' ), log4cplus = cms.untracked.PSet( threshold = cms.untracked.string('ERROR') ) ) # set the number of events process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5) ) process.myAnalysisModule = cms.EDAnalyzer('ModuleThatIssuesMessages') process.p = cms.Path(process.myAnalysisModule) )The service = MLlog4cplus informs the ssytem to attach a destination which will send messages of
log4cplus
.
The PSet log4cplus = {...} configures
that destination, just the same as any other output destination could be
configured.
Note, however, that the vstring destinations = {...}
list
must not
include "log4cplus"
. The contents of that vstring are used to
decide which ordinary file (or cout or cerr) destinations to create and attach.
Some special information pertaining to using log4cplus as a destination for messages:
log4cplus
. For instance,
LogWarning("category")
leads to a LOG4CPLUS_WARN(...)
call.
log4cplus
dispatches to "appenders". For example, a
fileAppender
may be established to write the text to
a file, or a consoleAppender
to write to the job console.
It is up to the user code or configuration file to establish which
appenders are wanted.
MLlog4cplus
service automatically
establishes a fileAppender