DCMTK  Version 3.6.1 20131114
OFFIS DICOM Toolkit
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
dcmtk::log4cplus::TTCCLayout Class Reference

TTCC layout format consists of time, thread, Logger and nested diagnostic context information, hence the name. More...

+ Inheritance diagram for dcmtk::log4cplus::TTCCLayout:
+ Collaboration diagram for dcmtk::log4cplus::TTCCLayout:

Public Member Functions

 TTCCLayout (bool use_gmtime=false)
 
 TTCCLayout (const log4cplus::helpers::Properties &properties)
 
virtual void formatAndAppend (log4cplus::tostream &output, const log4cplus::spi::InternalLoggingEvent &event)
 
- Public Member Functions inherited from dcmtk::log4cplus::Layout
 Layout (const helpers::Properties &properties)
 

Protected Attributes

log4cplus::tstring dateFormat
 
bool use_gmtime
 
- Protected Attributes inherited from dcmtk::log4cplus::Layout
LogLevelManagerllmCache
 

Private Member Functions

 TTCCLayout (const TTCCLayout &)
 
TTCCLayoutoperator= (const TTCCLayout &)
 

Detailed Description

TTCC layout format consists of time, thread, Logger and nested diagnostic context information, hence the name.

The time format depends on the DateFormat used. Use the Use_gmtime to specify whether messages should be logged using localtime or gmtime.

Here is an example TTCCLayout output:

176 [main] INFO  org.apache.log4j.examples.Sort - Populating an array of 2 elements in reverse order.
225 [main] INFO  org.apache.log4j.examples.SortAlgo - Entered the sort method.
262 [main] DEBUG org.apache.log4j.examples.SortAlgo.OUTER i=1 - Outer loop.
276 [main] DEBUG org.apache.log4j.examples.SortAlgo.SWAP i=1 j=0 - Swapping intArray[0] = 1 and intArray[1] = 0
290 [main] DEBUG org.apache.log4j.examples.SortAlgo.OUTER i=0 - Outer loop.
304 [main] INFO  org.apache.log4j.examples.SortAlgo.DUMP - Dump of interger array:
317 [main] INFO  org.apache.log4j.examples.SortAlgo.DUMP - Element [0] = 0
331 [main] INFO  org.apache.log4j.examples.SortAlgo.DUMP - Element [1] = 1
343 [main] INFO  org.apache.log4j.examples.Sort - The next log statement should be an error message.
346 [main] ERROR org.apache.log4j.examples.SortAlgo.DUMP - Tried to dump an uninitialized array.
467 [main] INFO  org.apache.log4j.examples.Sort - Exiting main method.

The first field is the number of milliseconds elapsed since the start of the program. The second field is the thread outputting the log statement. The third field is the LogLevel, the fourth field is the logger to which the statement belongs.

The fifth field (just before the '-') is the nested diagnostic context. Note the nested diagnostic context may be empty as in the first two statements. The text after the '-' is the message of the statement.

PatternLayout offers a much more flexible alternative.


The documentation for this class was generated from the following file:


Generated on Thu Dec 5 2013 for DCMTK Version 3.6.1 20131114 by Doxygen 1.8.5