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
. There are also ThreadPrinting
, CategoryPrefixing
and ContextPrinting
properties to turn on and off thread name, logger name and NDC context printing respectively.
Here is an example TTCCLayout output:
1 [0x60004dca0] WARN test.TestThread <> - Thread-3 TestThread.run()- Starting...
1 [0x60004dca0] TRACE SlowObject <Thread-3 loop> - ENTER: SlowObject::doSomething()
2 [0x60004b030] INFO SlowObject <Thread-0 loop> - Actually doing something...1, 2, 3, testing...DONE
2 [0x60004b130] INFO SlowObject <Thread-1 loop> - Actually doing something...
2 [0x60004b030] TRACE SlowObject <Thread-0 loop> - EXIT: SlowObject::doSomething()
2 [0x60004b030] TRACE SlowObject <Thread-0 loop> - ENTER: SlowObject::doSomething()
3 [0x60004b130] INFO SlowObject <Thread-1 loop> - Actually doing something...1, 2, 3, testing...DONE
3 [0x60004cad0] INFO SlowObject <Thread-2 loop> - Actually doing something...
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 value is the same as that of the t
formatter for PatternLayout.)
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.
Definition at line 165 of file layout.h.