Java 类org.apache.logging.log4j.simple.SimpleLogger 实例源码

项目:ProjectAres    文件:Logging.java   
public static org.apache.logging.log4j.Level getLevel(org.apache.logging.log4j.Logger logger) {
    if(logger instanceof org.apache.logging.log4j.core.Logger) {
        return ((org.apache.logging.log4j.core.Logger) logger).getLevel();
    } else if(logger instanceof SimpleLogger) {
        return ((SimpleLogger) logger).getLevel();
    } else {
        return null;
    }
}
项目:ProjectAres    文件:Logging.java   
public static void setLevel(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level) {
    if(logger instanceof org.apache.logging.log4j.core.Logger) {
        ((org.apache.logging.log4j.core.Logger) logger).setLevel(level);
    } else if(logger instanceof SimpleLogger) {
        ((SimpleLogger) logger).setLevel(level);
    }
}
项目:jgroups-3.6.4-fixed    文件:Log4J2LogImpl.java   
public void setLevel(String level) {
    Level new_level=strToLevel(level);
    if(new_level == null)
        return;
    if(logger instanceof org.apache.logging.log4j.core.Logger)
        ((org.apache.logging.log4j.core.Logger)logger).setLevel(new_level);
    else if(logger instanceof SimpleLogger)
        ((SimpleLogger)logger).setLevel(new_level);
}
项目:MyTown2    文件:TestMain.java   
public static void main() {
    PrintStream ps = new PrintStream(new FileOutputStream(FileDescriptor.out));
    MyTown.instance = new MyTown();
    MyTown.instance.LOG = new SimpleLogger("MyTown2-Test", Level.INFO, true, true, false, false, "DD/MM/YY", null, PropertiesUtil.getProperties(), ps);

    ps = new PrintStream(new FileOutputStream(FileDescriptor.out));
    MyEssentialsCore.instance = new MyEssentialsCore();
    MyEssentialsCore.instance.LOG = new SimpleLogger("MyEssentials-Core-Test", Level.INFO, true, true, false, false, "DD/MM/YY", null, PropertiesUtil.getProperties(), ps);
}
项目:logging-log4j2    文件:StatusLogger.java   
private StatusLogger(final String name, final MessageFactory messageFactory) {
    super(name, messageFactory);
    this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, Strings.EMPTY,
            messageFactory, PROPS, System.err);
    this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel();

    // LOG4J2-1813 if system property "log4j2.debug" is defined, print all status logging
    if (isDebugPropertyEnabled()) {
        logger.setLevel(Level.TRACE);
    }
}
项目:log4j2    文件:StatusLogger.java   
private StatusLogger() {
    this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, "", null, PROPS,
        System.err);
    this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel();
}