tags:

views:

57

answers:

1

Hi,

I'd like for log events of type WARN or higher to show the class name. All others would not show the class name. this is both to simplify the log and to not have the performance hit on lower events such as TRACE. This must all go to the same log file.

For example, right now, I have this on my log file:

2010-04-06 18:50:16,416 [main] INFO org.nyjord.lib.gather.TempMachine - initialised successfuly. 2010-04-06 18:50:16,416 [main] FATAL org.nyjord.lib.gather.TempMachine - not all paths could be located

I would prefer this ON THE SAME FILE:

2010-04-06 18:50:16,416 [main] INFO - initialised successfuly. 2010-04-06 18:50:16,416 [main] FATAL org.nyjord.lib.gather.TempMachine - not all paths could be located

Help would be really welcome.

A: 

This should be possible, by developing a custom Layout class that does what you want. But I doubt that any of the existing log4j Layout classes would be able to do this.

Stephen C
that's what i thought. Thank you for answer
gorca