Results 1 to 2 of 2
Thread: Couple quick log4j questions
- 06-22-2010, 01:10 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 13
- Rep Power
- 0
Couple quick log4j questions
First, if the threshold for an appender has been set and assigned to the rootLogger, is it possible to set the level of the same appender to a descendant with a lower level? For instance:
If appender A1 has threshold set to INFO, it will write to the appender but the level will be INFO instead of DEBUG.Java Code:log4j.logger.com.mikel.smart.metrics.envfilters.SeaState=DEBUG, A1 log4j.additivity.com.mikel.smart.metrics.envfilters.SeaState=False
Second, after additivity has been set to false, is it possible to add multiple appenders back to a descendant with different threshold levels? For example, I know:
Will add both A1 and A2 to the SeaState class at the WARN level, but what if I want A1 at DEBUG and A2 at WARN?Java Code:log4j.logger.com.mikel.smart.metrics.envfilters.SeaState=WARN, A1, A2
- 06-22-2010, 06:14 PM #2
I don't understand what you are asking for the first question, it is possible to have the root logger be set to level INFO by default and have an individual package be at DEBUG level, the messages should show up in the output as DEBUG. ?
For different levels to more than one appender, I know this is possible in logback with the use of filters Chapter 6: Filters
Where I have something written to two appenders and within each appender i have logic to only show if it of the specified level. this is to create separate error.log and debug.log files.
But sorry, I don't know how to do this in log4j
Similar Threads
-
Couple more questions on JAR Files :S
By Lil_Aziz1 in forum New To JavaReplies: 13Last Post: 06-05-2010, 08:44 AM -
Couple questions about Java
By theadolescent in forum New To JavaReplies: 3Last Post: 05-19-2010, 02:13 AM -
Couple Questions on Thread
By Lil_Aziz1 in forum Threads and SynchronizationReplies: 5Last Post: 01-06-2010, 02:02 PM -
Couple of questions regarding threading
By exernet in forum New To JavaReplies: 1Last Post: 12-15-2009, 12:23 PM -
Couple of newbie questions
By ananasman in forum New To JavaReplies: 11Last Post: 11-20-2008, 11:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks