Java Code Examples for org.slf4j.Logger#getName()

The following examples show how to use org.slf4j.Logger#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Log4jUtils.java    From incubator-ratis with Apache License 2.0 5 votes vote down vote up
static void setLogLevel(Logger logger, Level level) {
  final String name = logger.getName();
  if (LogUtils.LOG.isTraceEnabled()) {
    LogUtils.LOG.trace("", new Throwable("Set " + name + " log level to " + level));
  } else {
    LogUtils.LOG.info("Set {} log level to {}", name, level);
  }
  LogManager.getLogger(name).setLevel(level);
}
 
Example 2
Source File: LogUtils.java    From ratis with Apache License 2.0 5 votes vote down vote up
static void setLogLevel(Logger logger, Level level) {
  final String name = logger.getName();
  if (LOG.isTraceEnabled()) {
    LOG.trace("", new Throwable("Set " + name + " log level to " + level));
  } else {
    LOG.info("Set {} log level to {}", name, level);
  }
  LogManager.getLogger(name).setLevel(level);
}
 
Example 3
Source File: LoggerConverter.java    From graylog-plugin-metrics-reporter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public String convertTo(Logger logger) {
    if (logger == null) {
        throw new ParameterException("Couldn't convert \"null\" to string.");
    }
    return logger.getName();
}
 
Example 4
Source File: LoggerModel.java    From wisdom with Apache License 2.0 5 votes vote down vote up
public LoggerModel(Logger logger) {
    this.name = logger.getName();
    if (logger instanceof ch.qos.logback.classic.Logger) {
        this.level = ((ch.qos.logback.classic.Logger) logger).getEffectiveLevel().toString();
    } else {
        level = "unknown";
    }
}
 
Example 5
Source File: Slf4JLogger.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 6
Source File: Slf4JLogger.java    From getty with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 7
Source File: Slf4JLogger.java    From eagle with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 8
Source File: Slf4JLogger.java    From micrometer with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 9
Source File: StepsUtil.java    From multiapps-controller with Apache License 2.0 4 votes vote down vote up
public static String getLoggerPrefix(Logger logger) {
    String name = logger.getName();
    return "[" + name.substring(name.lastIndexOf('.') + 1) + "] ";
}
 
Example 10
Source File: StepLogger.java    From multiapps-controller with Apache License 2.0 4 votes vote down vote up
private static String getPrefix(Logger logger) {
    String name = logger.getName();
    return "[" + name.substring(name.lastIndexOf('.') + 1) + "] ";
}
 
Example 11
Source File: Slf4JLogger.java    From mynlp with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 12
Source File: LogbackSupport.java    From spring-boot-data-geode with Apache License 2.0 4 votes vote down vote up
private static String nullSafeLoggerName(Logger logger) {
	return logger != null ? logger.getName() : null;
}
 
Example 13
Source File: Slf4JLogger.java    From Jupiter with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 14
Source File: Slf4JLogger.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 15
Source File: Slf4JLogger.java    From couchbase-jvm-core with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 16
Source File: Slf4JLogger.java    From mango with Apache License 2.0 4 votes vote down vote up
Slf4JLogger(Logger logger) {
  super(logger.getName());
  this.logger = logger;
}