abk.logging.log4j
Class Logger4J

java.lang.Object
  extended by abk.logging.ACoreLogger
      extended by abk.logging.log4j.Logger4J

public class Logger4J
extends ACoreLogger

Implementa ACoreLogger mapeando los niveles de log4j a niveles de Level. El mapeo no puede ser idéntico. Se utiliza la siguientes reglas de conversión, donde la conversión primaria es la traducción desde java.util.logging a org.apache.log4j y la conversión secundaria son traducciones adicionales desde org.apache.log4j a java.util.logging.

java.util.logging método
ALogger
org.apache.log4j primaria org.apache.log4j secundaria
Level.SEVERE error() Level.ERROR Level.FATAL, UtilLoggingLevel.FATAL
Level.WARNING warn() Level.WARN UtilLoggingLevel.WARNING
Level.INFO info() Level.INFO UtilLoggingLevel.INFO
Level.CONFIG config() UtilLoggingLevel.CONFIG
Level.FINE debug() Level.DEBUG UtilLoggingLevel.FINE
Level.FINER trace() Level.TRACE UtilLoggingLevel.FINER
Level.FINEST Level.TRACE UtilLoggingLevel.FINEST


Field Summary
private  org.apache.log4j.Logger iLogger
           
 
Constructor Summary
Logger4J(String logName, Integer classStart)
           
 
Method Summary
 Level getLevel()
           
private static org.apache.log4j.Level getLevelFor(Level level)
           
private static Level getLevelFor(org.apache.log4j.Level prior)
           
 boolean isEnabledFor(Level level)
           
 void log(Class<?> fqc, String msg, Throwable t, Level level)
          Implementación de la salida de una traza para un mensaje, error y nivel indicados.
 void setLevel(Level level)
           
 
Methods inherited from class abk.logging.ACoreLogger
getClassName, getClassStart, getLogName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iLogger

private org.apache.log4j.Logger iLogger
Constructor Detail

Logger4J

public Logger4J(String logName,
                Integer classStart)
Method Detail

setLevel

public void setLevel(Level level)
Specified by:
setLevel in class ACoreLogger

getLevel

public Level getLevel()
Specified by:
getLevel in class ACoreLogger

isEnabledFor

public boolean isEnabledFor(Level level)
Specified by:
isEnabledFor in class ACoreLogger

log

public void log(Class<?> fqc,
                String msg,
                Throwable t,
                Level level)
Description copied from class: ACoreLogger
Implementación de la salida de una traza para un mensaje, error y nivel indicados.

Specified by:
log in class ACoreLogger
Parameters:
fqc - Nombre completo de la clase a partir de la cual se para la creación de la traza.
msg - Mensaje.
t - Error.
level - Nivel de la traza.

getLevelFor

private static final org.apache.log4j.Level getLevelFor(Level level)

getLevelFor

private static final Level getLevelFor(org.apache.log4j.Level prior)


Copyright © 2024. All rights reserved.