logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy <guy.van.tilbo...@gmail.com>
Subject logging all messages of one level (and only that level) to one file
Date Thu, 11 Sep 2008 08:50:09 GMT

In short what I want to do is to create a log that will log all my
exceptions to one file (but only the exceptions). Other functionality is
also needed so I will create an appender (that has been succesfull). But

So if i get an exception I would like to call the following:
logger.exception(stacktraceElements); and no matter the actual level in the
properties files, this message should be logged to my file.

Extending the Level class and creating a custom level will not reach this
goal because I want to use the following:

if (Level.Exception)
    //send to appender and let them decide if they want to print the message
or not

What do  I need to extend to be able to  change this and how do I have to
configure Log4J to make use of this mechanism?

any help would help

Guy Van Tilborgh

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message