本文整理汇总了Java中org.apache.log4j.Level.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java Level.ALL属性的具体用法?Java Level.ALL怎么用?Java Level.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.log4j.Level
的用法示例。
在下文中一共展示了Level.ALL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLevel
public Level getLevel(int traceLevel) {
if ( traceLevel == TRACE_INFO ) {
return Level.INFO;
} else if ( traceLevel == TRACE_ERROR ) {
return Level.ERROR;
} else if ( traceLevel == TRACE_DEBUG) {
return Level.DEBUG;
} else if (traceLevel == TRACE_TRACE) {
return Level.ALL;
} else {
return Level.OFF;
}
}
示例2: write
@Override
public void write(String loggerName, String filePrefix, String content) {
RollingFileAppender logger = fileAppenders.computeIfAbsent(loggerName, f -> initLogger(loggerName, filePrefix));
LoggingEvent event = new LoggingEvent(loggerName, Logger.getLogger(loggerName), Level.ALL,
content, null);
logger.append(event);
}
示例3: enableDebugLoggingIfRequired
public static boolean enableDebugLoggingIfRequired(
org.apache.hadoop.conf.Configuration conf) {
boolean result = false;
try {
Level desiredOraOopLoggingLevel =
Level.toLevel(conf.get(OraOopConstants.ORAOOP_LOGGING_LEVEL),
Level.INFO);
Level sqoopLogLevel =
Logger.getLogger(Sqoop.class.getName()).getParent().getLevel();
if (desiredOraOopLoggingLevel == Level.DEBUG
|| desiredOraOopLoggingLevel == Level.ALL
|| sqoopLogLevel == Level.DEBUG || sqoopLogLevel == Level.ALL) {
Category oraOopLogger =
Logger.getLogger(OraOopManagerFactory.class.getName()).getParent();
oraOopLogger.setLevel(Level.DEBUG);
LOG.debug("Enabled OraOop debug logging.");
result = true;
conf.set(OraOopConstants.ORAOOP_LOGGING_LEVEL, Level.DEBUG.toString());
}
} catch (Exception ex) {
LOG.error(String.format(
"Unable to determine whether debug logging should be enabled.\n%s",
getFullExceptionMessage(ex)));
}
return result;
}
示例4: main
/**
* Main entry point for the ecs application.
* @param args
*/
public static void main(String[] args) {
try {
new LogSetup("logs/ecs.log", Level.ALL);
app_KVEcs app = new app_KVEcs();
app.run();
} catch (IOException e) {
System.out.println("Error! Unable to initialize logger!");
e.printStackTrace();
System.exit(1);
}
}
示例5: main
/**
* Main entry point for the echo server application.
* @param args contains the port number at args[0].
*/
public static void main(String[] args) {
try {
new LogSetup("logs/server.log", Level.ALL);
app_KVServer app_kvserver = new app_KVServer();
app_kvserver.run(Integer.parseInt(args[0]));
// app_kvserver.run(50000);
} catch (NumberFormatException | IOException nfe) {
System.out.println("Error! Invalid argument <port> or <cacheSize>! Not a number!");
System.out.println("Usage: Server <port> <cacheSize> <strategy>!");
System.exit(1);
}
}
示例6: MessageBroker
public MessageBroker(String ip, int port){
changeSubscriberData = new SubscriberData();
deleteSubscriberData = new SubscriberData();
keyVerifier = new KVClient(ip, port);
try {
new LogSetup("logs/broker.log", Level.ALL);
} catch (IOException e) {
logger.error("Error!" + e.getMessage());
}
}
示例7: setLogLevel
/**
* Set logging level to given value. If not explicitly
* specified, default level is used from *logger* properties file.
* (As of the time writing - simplelogger.properties is used as default.)
* <p/>
* NOTE: SLF4J is not capable of changing log levels programatically!
* We have to change the System/File property of given underlying logger.
*
* @param logLevel logging level to be logger set to
*/
public static void setLogLevel(String logLevel) {
org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("com.redhat.mqe.jms");
Level level;
switch (logLevel.toLowerCase()) {
case "all":
level = Level.ALL;
break;
case "trace":
level = Level.TRACE;
break;
case "debug":
level = Level.DEBUG;
break;
case "info":
level = Level.INFO;
break;
case "warn":
level = Level.WARN;
break;
case "error":
level = Level.ERROR;
break;
case "fatal":
level = Level.FATAL;
break;
case "off":
level = Level.OFF;
break;
default:
level = Level.INFO;
}
LogManager.getRootLogger().setLevel(level);
logger.setLevel(level);
}
示例8: getThreshold
@Override
public Level getThreshold() {
return Level.ALL;
}
示例9: LogCaptorTestBase
public LogCaptorTestBase() {
super(Level.ALL);
}