-
1. Re: Logging into separate Files
peterj May 13, 2008 11:16 AM (in response to groscurth)Are you trying to, for instance, log only your code to the new log file? If so, you need to also add something like this:
<category name="my.package.name"> <priority value="DEBUG"/> <appender-ref ref="App1Log" /> </category>
And remove the < appender-ref ref="App1Log" > from within < root >
If you are attempting to prevent *any* logging to the console. remove the < appender-ref ref="CONSOLE" > line. -
2. Re: Logging into separate Files
groscurth May 14, 2008 2:57 AM (in response to groscurth)thanks for your answer peter.
the problem is that different web applications deployed on the jboss share same classes/libraries.
So if App1 and App2 both uses Library1, how to define in categorys that Library1 once has to log into App1Log file and another time in App2Log file.
Therefore the category system does not work for me :(
And actually I dont intend to remove ALL logs in the console - jboss system logs shall occur of course, but non of the web application logs....
is this then possible at all? -
3. Re: Logging into separate Files
peterj May 14, 2008 10:54 AM (in response to groscurth)You are asking for log4j to somehow know when to log a message from a particular class to one log file in one circumstance and under another circumstance to log it to another log file. Sorry, but log4j just will not do that.
-
4. Re: Logging into separate Files
genman May 14, 2008 1:31 PM (in response to groscurth)You can use a thread local, e.g. MDC and filter on that, assuming the library is going to be run from the same application's threads. Search for "MDC filter" in google.