2 Replies Latest reply on Nov 13, 2006 2:36 AM by marcus.klein

    Logging question: how to do 'local' and 'global' logging tog

    marcus.klein

      Hi,

      I have a question regarding logging with log4j. I used the example repositoryselector.zip (http://wiki.jboss.org/wiki/Wiki.jsp?page=Logging) from the Wiki Knowledge Base to enable logging on a per-webapp basis, i.e. now I can use a log4j.xml file for each deployment I have. This works fine so far. The problem I have now is that all logging messages are written to the appenders I specified in those 'local' log4j.xml file. How would I be able to specify that only some logging messages are written to the 'local' logging-file while others are still written, say, to the server.log?

      To make it a bit more precise, say, I have two classes A and B deployed as mydeployment application. Within the log4j.xml file below mydeployment I would like to specify that logging msgs from class A are written to a 'local' log-file (say classA.log), while logging messages from class B are written to the server.log. The example in repositoryselector.zip shows me only how to log either all msgs to server.log or to the 'local' specified log-file. Please note that the logging messages should appear only once, i.e. either in the server.log file xor in the 'local' log-file.

      Thank you very much for your help.