Changeset 1595


Ignore:
Timestamp:
2010-07-05 12:39:18 (23 months ago)
Author:
bruno
Message:

In case of console logging, log by default WARN and up messages, instead of ERROR. Reasoning: console logging is for development purposes, and often important things are being logged at warn level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/kauri-runtime-cli/src/main/java/org/kauriproject/runtime/cli/Logging.java

    r548 r1595  
    3838            } 
    3939        } else if (consoleLoggingLevel == null) { 
    40             // If there's not log configuration specified, and console logging not enabled, 
    41             // then default to printing error messages to the console 
     40            // If there is no log configuration specified, and console logging is not enabled, 
     41            // then default to printing warn and higher messages to the console 
    4242            System.out.println("Note: it is recommended to specify a log configuration. Will print error logs to the console."); 
    4343            Logger logger = Logger.getRootLogger(); 
    44             logger.setLevel(Level.ERROR); 
     44            logger.setLevel(Level.WARN); 
    4545            logger.addAppender(consoleAppender); 
    4646            consoleAppenderAdded = true; 
     
    6969                logger.setLevel(level); 
    7070 
    71                 if (consoleLogCategory != null) 
    72                     Logger.getRootLogger().setLevel(Level.ERROR); 
     71                if (consoleLogCategory != null) { 
     72                    // always log all warn-and-higher messages 
     73                    Logger.getRootLogger().setLevel(Level.WARN); 
     74                } 
    7375                 
    7476                Logger rootLogger = Logger.getRootLogger(); 
Note: See TracChangeset for help on using the changeset viewer.