Jerry Cwiklik (JIRA | 11 Jun 2012 23:23
Picon
Favicon

[jira] [Created] (UIMA-2421) Not able to change log level programmatically with UIMA logger

Jerry Cwiklik created UIMA-2421:
-----------------------------------

             Summary: Not able to change log level programmatically with UIMA logger
                 Key: UIMA-2421
                 URL: https://issues.apache.org/jira/browse/UIMA-2421
             Project: UIMA
          Issue Type: Bug
          Components: Core Java Framework
    Affects Versions: 2.4.0SDK
            Reporter: Jerry Cwiklik
            Priority: Minor
             Fix For: 2.4.1SDK

UIMA Logger setLevel(Level) only partially works. It changes the level associated with the logger, but
its not changing a level in any of its handlers (like ConsoleHandler). So the code,

logger.setLevel(Level.FINEST);
if ( logger.isLoggable(Level.FINEST) ) {
} 

works fine. What does *not* work is the following:

logger.log(Level.FINEST, aMessage);

The only workaround for this is to use, now deprecated, setOutputStream(System.out). 

Possible fix could be Uima Logger API extension to return an array of handlers associated with a logger. The
client application can than decide appropriate log levels for each of the handlers programatically. 

(Continue reading)


Gmane