logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@qos.ch>
Subject Re: Adding a Priority to the Appenders.
Date Thu, 04 Oct 2001 19:31:43 GMT

What a waste of time. The threshold option does what you want. 

At 18:52 04.10.2001 +0200, you wrote:
>> Hi Log4J development team
>> We did need to log to the NT eventlog and a file (our own log), through
>> the same category. Yes, that is not a problem because you just add the
>> FileAppender class and the NTEventLogAppender class. 
>> But now all priorities (assuming that the priority for category is DEBUG)
>> will be logged both in the file and in the NT eventlog. Our requirements
>> state that only log messages with the priority FATAL should be logged to
>> the NT eventlog and all should be logged to the file. This could be done
>> if the appender classes had a priority.
>> Therefore I did modify the Appender and Appenderskeleton with a Priority
>> attribute (see attached sourcecode) and a set/get method. After that I did
>> recompile all the child classes (at least the ones I had to use) of the
>> AppenderSkeleton class. The default for the Priority in the
>> AppenderSkeleton is DEBUG (lowest level, so this will make everything
>> works in current implementations which do not use this added
>> functionality).
>> The method appendLoopOnAppenders in the AppenderAttachableImpl class also
>> needed to be changed (see attached sourcecode), so that it checks the
>> priority of the appender with the priority of the loggingevent.
>> I think this is a nice feature and would like your comment on it. 
>> Of course this uses the same technique, regarding priority, as the
>> category class. But a really nice feature could be a prioritylist in the
>> appenderSkeleton class. So a implemented appender (like FileAppender)
>> could log message of for instance INFO and ERROR and not DEBUG, WARN and
>> Please let me know if this suggestion could be done in a much nicer way. 
>> Venlig hilsen / Best regards
>> Ronni Lück
>> Sybase Professional Services, Denmark
>> e-mail: ronni.luck@sybase.com
>> mobile: +45 40 91 43 59
>> phone: +45 39 27 79 13
>> fax: +45 39 27 79 12
>>  <<Appender.java>>  <<AppenderSkeleton.java>>  
>> <<AppenderAttachableImpl.java>> 
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

Ceki Gülcü - http://qos.ch

To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

View raw message