When using log4perl, the debug log layout I am using is:
log4perl.appender.D10.layout=PatternLayout log4perl.appender.D10.layout.ConversionPattern=%d [pid=%P] %p %F{1} (%L) %M %m%n log4perl.appender.D10.Filter = DebugAndUp
This creates very detailed debug logs, for example:
2008/11/26 11:57:28 [pid=25485] DEBUG SomeModule.pm (331) functions::SomeModule::Test Test XXX was successfull 2008/11/26 11:57:29 [pid=25485] ERROR SomeOtherUnrelatedModule.pm (99999) functions::SomeModule::AnotherTest AnotherTest YYY has faled
This works great and provides excellent debugging data.
However, each line of the debug log contains different function names, pid length, etc. This makes the difference between each line and makes reading debug logs much more difficult than necessary.
Is there a way in log4perl to format the string so that debug metadata (everything up to the actual log message) is filled with spaces / tabs at the end and do the actual messages start in one column of text?
source share