OFF
FATAL
ERROR
WARN
INFO
DEBUG
TRACE
ALL
The Level class may be subclassed to define a larger level set. @author Ceki Gülcü @author Yoav Shapira
Level
9899100101102103104105106107108
if (rs != null) { while(rs.next()) { Level l = new DynamicLevel (rs.getInt("LJLEVEL"),rs.getString("LCODE"),rs.getInt("LSYSLOGEQUIV")); Integer levelint = new Integer(rs.getInt("LSYSLOGEQUIV")); htLevels.put(levelint, l); } }
5051525354555657585960
datalog =(TLogQueue)(adtmsg.getAdtPayload()); Category logger = Logger.getLogger(datalog.getLuser()+ "." +datalog.getLsection()); // convert the PL/SQL log level in LOG4J level Level level = (DynamicLevel)htLevels.get(new Integer (datalog.getLlevel().intValue())); if (level != null) { priority = level; } else { priority = Level.toLevel("UNDEFINED", Level.ERROR );
3435363738394041424344
@Override public boolean isEnabled(String context, int level) { if ( context == null ) { return false; } Level logLevel = convert2Log4JLevel(level); if ( logLevel == Level.OFF) { return false; } Logger log = getLogger(context); return log.isEnabledFor(logLevel);
949596979899100101102
* * @param level * @return prior level */ public static Level setLogging(Level level) { Level prior = s_logger.getLevel(); s_logger.setLevel(level); return prior; }
414243444546474849505152
} public void testLog4JLoggerTraceEnabled() throws Exception { final Level level = Level.DEBUG; final Level type = Level.DEBUG; final String message = "Meep!"; final Throwable throwable = null; final boolean output = true; final MockAppender target = new MockAppender();
5657585960616263646566
} public void testLog4JLoggerTraceDisabled() throws Exception { final Level level = Level.ERROR; final String message = "Meep!"; final MockAppender target = new MockAppender(); final Log4JLogger logger = createLogger( target, level ); logger.trace( message );
686970717273747576777879
} public void testLog4JLoggerTraceWithExceptionEnabled() throws Exception { final Level level = Level.DEBUG; final Level type = Level.DEBUG; final String message = "Meep!"; final Throwable throwable = new Throwable(); final boolean output = true; final MockAppender target = new MockAppender();
8485868788899091929394
} public void testLog4JLoggerTraceWithExceptionDisabled() throws Exception { final Level level = Level.ERROR; final String message = "Meep!"; final Throwable throwable = new Throwable(); final MockAppender target = new MockAppender(); final Log4JLogger logger = createLogger( target, level );
9899100101102103104105106107108109
} public void testLog4JLoggerDebugEnabled() throws Exception { final Level level = Level.DEBUG; final Level type = Level.DEBUG; final String message = "Meep!"; final Throwable throwable = null; final boolean output = true; final MockAppender target = new MockAppender();
113114115116117118119120121122123
} public void testLog4JLoggerDebugDisabled() throws Exception { final Level level = Level.ERROR; final String message = "Meep!"; final MockAppender target = new MockAppender(); final Log4JLogger logger = createLogger( target, level ); logger.debug( message );