The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.util.logging  [20 examples]

e386. Determining If a Message Will Be Logged

See also e389 Minimizing the Impact of Logging Code.
    Logger logger = Logger.getLogger("com.mycompany.MyClass");
    
    // Check if the message will be logged
    if (logger.isLoggable(Level.FINEST)) {
        logger.finest("my finest message");
    }

 Related Examples
e385. The Quintessential Logging Program
e387. Logging a Method Call
e388. Logging an Exception
e389. Minimizing the Impact of Logging Code
e390. Preventing a Logger from Forwarding Log Records to Its Parent
e391. Writing Log Records to a Log File
e392. Writing Log Records to Standard Error
e393. Writing Log Records Only After a Condition Occurs
e394. Setting a Filter on a Logger Handler

See also: Configuration    File Size    Formatters    Levels   


© 2002 Addison-Wesley.