Java Code Examples for org.apache.logging.log4j.Logger#getName()

The following examples show how to use org.apache.logging.log4j.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: ESLoggerFactory.java    From crate with Apache License 2.0 5 votes vote down vote up
static Logger getLogger(String prefix, Logger logger) {
    /*
     * In a followup we'll throw an exception if prefix is null or empty
     * redirecting folks to LogManager.getLogger.
     *
     * This and more is tracked in https://github.com/elastic/elasticsearch/issues/32174
     */
    if (prefix == null || prefix.length() == 0) {
        return logger;
    }
    return new PrefixLogger((ExtendedLogger)logger, logger.getName(), prefix);
}
 
Example 2
Source File: DeprecationLogger.java    From crate with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new deprecation logger based on the parent logger. Automatically
 * prefixes the logger name with "deprecation", if it starts with "org.elasticsearch.",
 * it replaces "org.elasticsearch" with "org.elasticsearch.deprecation" to maintain
 * the "org.elasticsearch" namespace.
 */
public DeprecationLogger(Logger parentLogger) {
    String name = parentLogger.getName();
    if (name.startsWith("org.elasticsearch")) {
        name = name.replace("org.elasticsearch.", "org.elasticsearch.deprecation.");
    } else {
        name = "deprecation." + name;
    }
    this.logger = LogManager.getLogger(name);
}
 
Example 3
Source File: Log4J2Logger.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
Log4J2Logger(Logger logger) {
    super((ExtendedLogger) logger, logger.getName(), logger.getMessageFactory());
}
 
Example 4
Source File: Log4J2Logger.java    From getty with Apache License 2.0 4 votes vote down vote up
Log4J2Logger(Logger logger) {
    super((ExtendedLogger) logger, logger.getName(), logger.getMessageFactory());
    if (VARARGS_ONLY) {
        throw new UnsupportedOperationException("Log4J2 version mismatch");
    }
}
 
Example 5
Source File: Log4J2Logger.java    From eagle with Apache License 2.0 4 votes vote down vote up
Log4J2Logger(Logger logger) {
    super(logger.getName());
    this.logger = logger;
}
 
Example 6
Source File: ESPluginLoggerFactory.java    From elasticsearch-analysis-hanlp with Apache License 2.0 4 votes vote down vote up
static public Logger getLogger(String prefix, Logger logger) {
    return (Logger)(prefix != null && prefix.length() != 0 ? new PrefixPluginLogger((ExtendedLogger)logger, logger.getName(), prefix) : logger);
}
 
Example 7
Source File: BHBotLogger.java    From BHBot with GNU General Public License v3.0 4 votes vote down vote up
private BHBotLogger(final Logger logger) {
    super((AbstractLogger) logger, logger.getName(), logger.getMessageFactory());
    this.logger = this;
}
 
Example 8
Source File: Log4J2Logger.java    From mynlp with Apache License 2.0 4 votes vote down vote up
Log4J2Logger(Logger logger) {
    super((ExtendedLogger) logger, logger.getName(), logger.getMessageFactory());
}
 
Example 9
Source File: MuLogger.java    From vethrfolnir-mu with GNU General Public License v3.0 4 votes vote down vote up
public static MuLogger getLogger(Class<?> type)
{
	Logger logger = LogManager.getLogger(type);
	return new MuLogger((AbstractLogger) logger, logger.getName(), logger.getMessageFactory());
}
 
Example 10
Source File: MuLogger.java    From vethrfolnir-mu with GNU General Public License v3.0 4 votes vote down vote up
public static MuLogger getLogger(String name)
{
	Logger logger = LogManager.getLogger(name);
	return new MuLogger((AbstractLogger) logger, logger.getName(), logger.getMessageFactory());
}
 
Example 11
Source File: Log4J2Logger.java    From mango with Apache License 2.0 4 votes vote down vote up
Log4J2Logger(Logger logger) {
  super(logger.getName());
  this.logger = logger;
}