Mantis - Resin
Viewing Issue Advanced Details
1184 minor always 06-06-06 10:58 06-27-06 08:53
ferg  
ferg  
normal  
closed  
fixed  
none    
none 3.0.20  
0001184: log level in ErrorPageManager
(rep by Bill Au)

It looks like only certain exceptions (like CompileException) is
logged at the warning level. Everything else is logged at fine.
Shouldn't all exceptions be logged at the warning level?


Notes
(0001270)
ferg   
06-07-06 07:33   
We have a LoggerManager class to wrap calls to Logger
 
public class LoggerManager
{
    static public Logger getLogger( Object object )
    {
        return getLogger( object.getClass().getName() );
    }
 
    static public Logger getLogger( String loggerName )
    {
        String METHOD = "getLogger";
        Logger logger = Logger.getLogger( loggerName );
        // Don't add the handlers if logging is disabled.
        if( isLoggingEnabled() )
        {
            // Add handlers to the logger
            if ( logger.getHandlers() == null || logger.getHandlers().length == 0 )
            {
                try
                {
                    if ( (loggingMode & MULTICAST_LOGGING) == MULTICAST_LOGGING )
                    {
                        logger.addHandler( new LogHandler() );
                    }
                    
                    if ( (loggingMode & STDERR_LOGGING) == STDERR_LOGGING )
                    {
                        logger.addHandler( new StderrHandler() );
                    }
                }
                catch ( Exception e )
                {
                    System.err.println( "Error adding LogHandler() to the logger: " + e.getMessage() );
                }
            }
            // WE do dot want to propogate any messages or the system logger will output to the console
            logger.setUseParentHandlers( false );
        }
        return logger;
    }
}
 
So we do something like this:
 
Logger logger = LoggerManager.getLogger( this );
 
This is essentially what you do below. However, we do not use the "shortcut" methods like logger.fine(), logger.finest() excepting entering() and exiting(). We always user logger.logp() or logger.entering(), logger,exiting().