logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick.Grim...@xtl.com
Subject Re: Logging from appender
Date Thu, 11 Sep 2008 15:59:23 GMT
I'm not an expert on Log4j, but recently had a similar requirement.  I didn't
want debug messages appearing on the console.  So on my console appender, I set
a threshold like this:


I got that from somebody else on this list.  This way I only see INFO messages
and above on the console and I see everything in my log file from debug up.  If
you did the same but set the threshold above WARN, the console will only show
messages above WARN, however you won't see anything less than or equal to WARN
on the console.  Don't know if that helps.  I think the log4j configuration in
XML allows for a min and max threshold.
(Embedded image moved to file: pic17673.jpg)

             "Bruno Melloni"                                                    
             .com>                                                           To 
                                         "Log4J Users List"                     
             09/11/2008 11:53 AM         <log4j-user@logging.apache.org>        
              Please respond to                                         Subject 
             "Log4J Users List"          Logging from appender                  

What is the best way to send a message to the log from inside the
Appender itself?  (separate from the message that the appender is
currently processing)

Why do I even ask this?  My appender checks disk utilization every hour.
I'd like to record the % of disk utilized in the log.

I tried using LogLog.warn(), but it puts the message on the console, not
in the log file generated by the appender.  I could probably add it
manually to the code that writes to the file, but that feels messy...
and I suspect that there's built-in log4j functionality for what I want
to do.


View raw message