Package org.apache.cxf.common.logging
Class LogUtils
java.lang.Object
org.apache.cxf.common.logging.LogUtils
A container for static utility methods related to logging.
 By default, CXF logs to java.util.logging. An application can change this. To log to another system, the
 application must provide an object that extends 
AbstractDelegatingLogger, and advertise that class
 via one of the following mechanisms:
 - Create a file, in the classpath, named META-INF/cxf/org.apache.cxf.Logger. This file should contain the fully-qualified name of the class, with no comments, on a single line.
- Call setLoggerClass(Class)with a Class<?> reference to the logger class.
Slf4jLogger to use slf4j instead of java.util.logging.- 
Method SummaryModifier and TypeMethodDescriptionprotected static LoggercreateLogger(Class<?> cls, String name, String loggerName) Create a loggerstatic LoggergetL7dLogger(Class<?> cls) Get a Logger with the associated default resource bundle for the class.static LoggergetL7dLogger(Class<?> cls, String resourcename) Get a Logger with an associated resource bundle.static LoggergetL7dLogger(Class<?> cls, String resourcename, String loggerName) Get a Logger with an associated resource bundle.static LoggerGet a Logger with the associated default resource bundle for the class.static LoggerGet a Logger with an associated resource bundle.static LoggerGet a Logger with an associated resource bundle.static voidChecks log level and logsstatic voidChecks log level and logsstatic voidChecks log level and logsstatic voidChecks log level and logsstatic voidAllows both parameter substitution and a typed Throwable to be logged.static voidAllows both parameter substitution and a typed Throwable to be logged.static voidsetLoggerClass(Class<? extends AbstractDelegatingLogger> cls) Specify a logger class that inherits fromAbstractDelegatingLogger.
- 
Method Details- 
setLoggerClassSpecify a logger class that inherits fromAbstractDelegatingLogger. Enable users to use their own logger implementation.
- 
getLoggerGet a Logger with the associated default resource bundle for the class.- Parameters:
- cls- the Class to contain the Logger
- Returns:
- an appropriate Logger
 
- 
getLoggerGet a Logger with an associated resource bundle.- Parameters:
- cls- the Class to contain the Logger
- resourcename- the resource name
- Returns:
- an appropriate Logger
 
- 
getLoggerGet a Logger with an associated resource bundle.- Parameters:
- cls- the Class to contain the Logger (to find resources)
- resourcename- the resource name
- loggerName- the full name for the logger
- Returns:
- an appropriate Logger
 
- 
getL7dLoggerGet a Logger with the associated default resource bundle for the class.- Parameters:
- cls- the Class to contain the Logger
- Returns:
- an appropriate Logger
 
- 
getL7dLoggerGet a Logger with an associated resource bundle.- Parameters:
- cls- the Class to contain the Logger
- resourcename- the resource name
- Returns:
- an appropriate Logger
 
- 
getL7dLoggerGet a Logger with an associated resource bundle.- Parameters:
- cls- the Class to contain the Logger (to find resources)
- resourcename- the resource name
- loggerName- the full name for the logger
- Returns:
- an appropriate Logger
 
- 
createLoggerCreate a logger
- 
logpublic static void log(Logger logger, Level level, String message, Throwable throwable, Object parameter) Allows both parameter substitution and a typed Throwable to be logged.- Parameters:
- logger- the Logger the log to
- level- the severity level
- message- the log message
- throwable- the Throwable to log
- parameter- the parameter to substitute into message
 
- 
logpublic static void log(Logger logger, Level level, String message, Throwable throwable, Object... parameters) Allows both parameter substitution and a typed Throwable to be logged.- Parameters:
- logger- the Logger the log to
- level- the severity level
- message- the log message
- throwable- the Throwable to log
- parameters- the parameters to substitute into message
 
- 
logChecks log level and logs- Parameters:
- logger- the Logger the log to
- level- the severity level
- message- the log message
 
- 
logChecks log level and logs- Parameters:
- logger- the Logger the log to
- level- the severity level
- message- the log message
- throwable- the Throwable to log
 
- 
logChecks log level and logs- Parameters:
- logger- the Logger the log to
- level- the severity level
- message- the log message
- parameter- the parameter to substitute into message
 
- 
logChecks log level and logs- Parameters:
- logger- the Logger the log to
- level- the severity level
- message- the log message
- parameters- the parameters to substitute into message
 
 
-