Tabnine Logo
LoggerFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
LoggerFactory
in
org.slf4j

Best Java code snippets using org.slf4j.LoggerFactory (Showing top 20 results out of 27,144)

origin: alibaba/druid

@Override
public void setConnectionLoggerName(String connectionLoggerName) {
  this.connectionLoggerName = connectionLoggerName;
  connectionLogger = LoggerFactory.getLogger(connectionLoggerName);
}
origin: dropwizard/dropwizard

/**
 * Creates a new LogConfigurationTask.
 */
public LogConfigurationTask() {
  this(LoggerFactory.getILoggerFactory());
}
origin: redisson/redisson

private final static void performInitialization() {
  bind();
  if (INITIALIZATION_STATE == SUCCESSFUL_INITIALIZATION) {
    versionSanityCheck();
  }
}
origin: ctripcorp/apollo

private void tryConfigCLogging() throws Exception {
 String appId = Foundation.app().getAppId();
 if (Strings.isNullOrEmpty(appId)) {
  logger.warn("App id is null or empty!");
  return;
 }
 LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
 Class clazz = Class.forName(cLoggingAppenderClass);
 Appender cLoggingAppender = (Appender) clazz.newInstance();
 ReflectionUtils.findMethod(clazz, "setAppId", String.class).invoke(cLoggingAppender, appId);
 ReflectionUtils.findMethod(clazz, "setServerIp", String.class)
   .invoke(cLoggingAppender, cloggingUrl());
 ReflectionUtils.findMethod(clazz, "setServerPort", int.class)
   .invoke(cLoggingAppender, Integer.parseInt(cloggingPort()));
 cLoggingAppender.setName("CentralLogging");
 cLoggingAppender.setContext(loggerContext);
 cLoggingAppender.start();
 ch.qos.logback.classic.Logger logger =
   (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("root");
 logger.addAppender(cLoggingAppender);
}
origin: alibaba/druid

@Override
public void setDataSourceLoggerName(String dataSourceLoggerName) {
  this.dataSourceLoggerName = dataSourceLoggerName;
  dataSourceLogger = LoggerFactory.getLogger(dataSourceLoggerName);
}
origin: neo4j/neo4j

public Slf4jLogProvider()
{
  this( LoggerFactory.getILoggerFactory() );
}
origin: alibaba/druid

@Override
public void setResultSetLoggerName(String resultSetLoggerName) {
  this.resultSetLoggerName = resultSetLoggerName;
  resultSetLogger = LoggerFactory.getLogger(resultSetLoggerName);
}
origin: gocd/gocd

LogConfigurator(String configDir, String childLogbackConfigFile) {
  this.configDir = configDir;
  this.childLogbackConfigFile = childLogbackConfigFile;
  this.loggerFactory = LoggerFactory.getILoggerFactory();
}
origin: alibaba/druid

@Override
public void setStatementLoggerName(String statementLoggerName) {
  this.statementLoggerName = statementLoggerName;
  statementLogger = LoggerFactory.getLogger(statementLoggerName);
}
origin: netty/netty

Slf4JLoggerFactory(boolean failIfNOP) {
  assert failIfNOP; // Should be always called with true.
  if (LoggerFactory.getILoggerFactory() instanceof NOPLoggerFactory) {
    throw new NoClassDefFoundError("NOPLoggerFactory not supported");
  }
}
origin: alibaba/druid

public SLF4JImpl(String loggerName){
  this.log = (LocationAwareLogger) LoggerFactory.getLogger(loggerName);
}
origin: redisson/redisson

Slf4JLoggerFactory(boolean failIfNOP) {
  assert failIfNOP; // Should be always called with true.
  if (LoggerFactory.getILoggerFactory() instanceof NOPLoggerFactory) {
    throw new NoClassDefFoundError("NOPLoggerFactory not supported");
  }
}
origin: Netflix/zuul

public AccessLogPublisher(String loggerName, BiFunction<Channel, HttpRequest, String> requestIdProvider)
{
  this.logger = LoggerFactory.getLogger(loggerName);
  this.requestIdProvider = requestIdProvider;
}
origin: ch.qos.logback/logback-classic

@Override
protected StatusManager getStatusManager(HttpServletRequest req, HttpServletResponse resp) {
  LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
  return lc.getStatusManager();
}
origin: eclipse-vertx/vert.x

SLF4JLogDelegate(final String name) {
 logger = LoggerFactory.getLogger(name);
}
origin: ch.qos.logback/logback-classic

@Override
protected String getPageTitle(HttpServletRequest req, HttpServletResponse resp) {
  LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
  return "<h2>Status messages for LoggerContext named [" + lc.getName() + "]</h2>\r\n";
}
origin: apache/incubator-druid

public Logger(String name)
{
 log = LoggerFactory.getLogger(name);
}
origin: redisson/redisson

/**
 * Return a logger named according to the name parameter using the
 * statically bound {@link ILoggerFactory} instance.
 * 
 * @param name
 *            The name of the logger.
 * @return logger
 */
public static Logger getLogger(String name) {
  ILoggerFactory iLoggerFactory = getILoggerFactory();
  return iLoggerFactory.getLogger(name);
}
origin: apache/incubator-druid

public Logger(Class clazz)
{
 log = LoggerFactory.getLogger(clazz);
}
origin: apache/rocketmq

public Slf4jLoggerFactory() {
  LoggerFactory.getILoggerFactory();
  doRegister();
}
org.slf4jLoggerFactory

Javadoc

The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for log4j, logback and JDK 1.4 logging. Other implementations such as org.slf4j.impl.NOPLogger and org.slf4j.impl.SimpleLogger are also supported.

LoggerFactory is essentially a wrapper around an ILoggerFactory instance bound with LoggerFactory at compile time.

Please note that all methods in LoggerFactory are static.

Most used methods

  • getLogger
    Return a logger named according to the name parameter using the statically bound ILoggerFactory inst
  • getILoggerFactory
    Return the ILoggerFactory instance in use. ILoggerFactory instance is bound with this class at com
  • bind
  • performInitialization
  • versionSanityCheck
  • failedBinding
  • findPossibleStaticLoggerBinderPathSet
    Our customized implementation here favors the Thread#getContextClassLoader() (typically the Catalina
  • isAmbiguousStaticLoggerBinderPathSet
  • messageContainsOrgSlf4jImplStaticLoggerBinder
  • reportActualBinding
  • reportMultipleBindingAmbiguity
    Prints a warning message on the console if multiple bindings were found on the class path. No report
  • nonMatchingClasses
  • reportMultipleBindingAmbiguity,
  • nonMatchingClasses,
  • emitReplayOrSubstituionWarning,
  • emitReplayWarning,
  • emitSubstitutionWarning,
  • fixSubstituteLoggers,
  • isAndroid,
  • replayEvents,
  • replaySingleEvent,
  • emitSubstituteLoggerWarning

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JLabel (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now