Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:43

0001 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
0002 <BODY bgcolor="FFFFFF">
0003 <title>
0004           CMS MessageLogger: Routing Messges to log4cplus
0005 </title>
0006 
0007 <center>
0008 <h1> <img src="header-public.gif" align="center"> </h1>
0009 
0010 <font color=red>
0011 <h1>CMS MessageLogger Service
0012 <br> 
0013 Routing Messges to <code>log4cplus</code></h1>
0014 </font>
0015 </center>
0016 
0017 <pre>
0018 process TEST = {
0019   <font color=red>service = MLlog4cplus</font>
0020   service = MessageLogger {
0021     vstring destinations = {   "detailedInfo.txt"  }
0022     <font color=red>PSet log4cplus     = { string threshold = "ERROR"   }</font>
0023   }
0024   untracked PSet maxEvents = {untracked int32 input = 5}
0025   path p = { myAnalysisModule }
0026   module myAnalysisModule = ModuleThatIssuesMessages { }
0027   source = EmptySource { }
0028 }
0029 </pre>
0030 
0031 The <font color=red>service = MLlog4cplus</font> informs the ssytem to 
0032 attach a destination 
0033 which will send messages of <code>log4cplus</code>.  
0034 The <font color=red>PSet log4cplus     = {...}</font> configures 
0035 that destination, just the same as any other output destination could be 
0036 configured.
0037 <p>
0038 Note, however, that the <code>vstring destinations = {...}</code> list
0039 <em>must not</em>
0040 include <code>"log4cplus"</code>.  The contents of that vstring are used to
0041 decide which ordinary file (or cout or cerr) destinations to create and attach.
0042 <p>
0043 Some special information pertaining to using log4cplus as a destination for
0044 messages:
0045 <ul>
0046 <li>
0047 The four severities of MessageLogger messages correspond to the four 
0048 directives for issuing to <code>log4cplus</code>.  For instance,
0049 <code>LogWarning("category")</code> leads to a <code>LOG4CPLUS_WARN(...)</code>
0050 call.
0051 <li>
0052 <code>log4cplus</code> dispatches to "appenders". For example, a 
0053 <code>fileAppender</code> may be established to write the text to 
0054 a file, or a <code>consoleAppender</code> to write to the job console.
0055 It is up to the user code or configuration file to establish which
0056 appenders are wanted.
0057 <li>
0058 In the current implementation, 
0059 the <code>MLlog4cplus</code> service automatically
0060 establishes a <code>fileAppender</code> writing <code>log4cplus.ouput</code>.
0061 CMS may decide instead that only appenders explicitly requested should be
0062 established, in which case that automatic appender feature will be removed. 
0063 <li>
0064 The noLineBreaks option is set by default, so that the text sent to 
0065 log4cplus will be a single line for each message.  
0066 If the user injects explicit <code>\n</code>
0067 linebreaks, however, these will become part of the message, which will no longer
0068 be a single line.
0069 <li>
0070 The context and module label information sent to log4cplus will match that 
0071 in the message itself.
0072 <li>
0073 All threshold, limit, timespan, and any other options which can be configured
0074 for an output destination in the .cfg file, can also be configured for the
0075 <code>log4cplus</code> destination. If a message would not be reported by a 
0076 destination configured in that manner, 
0077 then no <code>LOG4CPLUS_XXXX(...)</code> will be called.
0078 </ul> 
0079 
0080 
0081 
0082 
0083 <p><center>
0084 <img src="bar.gif"></center>
0085 
0086 <p><center>
0087 <a href="http://www.uscms.org/SoftwareComputing/index.html">
0088 USCMS Software and Computing Home Page </a> - 
0089 <a href="MessageLogger.html"> CMS MessageLogger Service Page </a> -
0090 <a href="parameters.html#example"> Configuration File </a>
0091 </center>
0092 
0093 <p>
0094       <hr>
0095       <address><a href="mailto:mf@fnal.gov">Mark Fischler</a></address>
0096 <!-- hhmts start -->
0097 Last modified: November 29, 2005
0098 <!-- hhmts end -->
0099 </body>
0100