This project has moved and is read-only. For the latest updates, please go here.

Precision specifier for Logger column

Dec 27, 2010 at 4:01 PM

Love the Log2Console application.

Here's one feature request. I tend to use the convention of naming logs by namespace. Each logger will be named either <fully-qualified class name> or <fully-qualified class name>.<instance name>. While this creates a nice hierarchy of loggers, the Logger column is not very useful any more as you can't determine the context based on the value in the Logger column. What I'd like to be able to do is specify a default precision for the Logger column (and ideally then be able to override it for any specific loggers). The precision specifier would act like it does in the PatternLayout class:

If a precision specifier is given, then only the corresponding number of right most components of the logger name will be printed. By default the logger name is printed in full.

For example, for the logger name "a.b.c" the pattern %logger{2} will output "b.c".

So if I specified a default precision of 2 for Log2Console, all the entries in the Logger column would show up as 'b.c', rather than just 'c'.

Does this sound useful/reasonable? Is there a better way to solve this problem?