posted 19 years ago
Arvind,
If you want to define custom levels like TRACE, you could do this by writing a class which extends org.apache.log4j.Level.
there's an example,XLevel, in the log4j distribution. This is a subclass of Level and adds TRACE, LETHAL.
After writing a custom level class, there are two steps to follow. Configure this new calss, and fire custom log events.
1.Configuration
since, DEBUG is the default level, in order to print levels less than DEBUG should be configured.
my sample config file looks like this:
2. Using custom levels:
here's the output.
Hope that helps.
Regards,