[jboss-user] [Beginners Corner] - Logging question: how to do 'local' and 'global' logging tog

marcus.klein do-not-reply at jboss.com
Fri Oct 27 10:04:59 EDT 2006


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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981304#3981304

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981304



More information about the jboss-user mailing list