Package org.jivesoftware.util
Class Log
- java.lang.Object
-
- org.jivesoftware.util.Log
-
public final class Log extends Object
Openfire makes use of a logging facade (slf4j) to manage its log output. The facade is backed up by Log4j by default. This class provides utility methods.Additionally, this class provides methods that can be used to record logging statements. These methods are exact duplicates of the previous Log implementation of Openfire and are kept for backwards-compatibility (the are deprecated). These methods will delegate logging functionality to slf4j. Instead of these methods, slf4j logging functionality should be used directly.
- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
- See Also:
- http://www.slf4j.org/
-
-
Field Summary
Fields Modifier and Type Field Description static SystemProperty<Boolean>DEBUG_ENABLEDstatic StringLOG_DEBUG_ENABLEDDeprecated.in favour ofDEBUG_ENABLEDstatic StringLOG_TRACE_ENABLEDDeprecated.in favour ofTRACE_ENABLEDstatic SystemProperty<Boolean>TRACE_ENABLED
-
Constructor Summary
Constructors Constructor Description Log()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voiddebug(String s)Deprecated.replaced byLogger.debug(String).static voiddebug(String s, Throwable throwable)Deprecated.replaced byLogger.debug(String, Throwable).static voiddebug(Throwable throwable)Deprecated.replaced byLogger.debug(String, Throwable).static voiderror(String s)Deprecated.replaced byLogger.error(String).static voiderror(String s, Throwable throwable)Deprecated.replaced byLogger.error(String, Throwable).static voiderror(Throwable throwable)Deprecated.replaced byLogger.error(String, Throwable).static StringgetLogDirectory()Returns the directory that log files exist in.static voidinfo(String s)Deprecated.replaced byLogger.info(String).static voidinfo(String s, Throwable throwable)Deprecated.replaced byLogger.info(String, Throwable).static voidinfo(Throwable throwable)Deprecated.replaced byLogger.info(String, Throwable).static booleanisDebugEnabled()Deprecated.replaced byLogger.isDebugEnabled().static booleanisErrorEnabled()Deprecated.replaced byLogger.isErrorEnabled().static booleanisInfoEnabled()Deprecated.replaced byLogger.isInfoEnabled().static booleanisWarnEnabled()Deprecated.replaced byLogger.isWarnEnabled().static voidmarkDebugLogFile(String username)static voidmarkErrorLogFile(String username)static voidmarkInfoLogFile(String username)static voidmarkWarnLogFile(String username)static voidrotateAllLogFile()static voidrotateDebugLogFile()static voidrotateErrorLogFile()static voidrotateInfoLogFile()static voidrotateWarnLogFile()static voidsetDebugEnabled(boolean enabled)static voidsetTraceEnabled(boolean enabled)static voidwarn(String s)Deprecated.replaced byLogger.warn(String).static voidwarn(String s, Throwable throwable)Deprecated.replaced byLogger.debug(String, Throwable).static voidwarn(Throwable throwable)Deprecated.replaced byLogger.warn(String, Throwable).
-
-
-
Field Detail
-
DEBUG_ENABLED
public static final SystemProperty<Boolean> DEBUG_ENABLED
-
LOG_DEBUG_ENABLED
@Deprecated public static final String LOG_DEBUG_ENABLED
Deprecated.in favour ofDEBUG_ENABLED
-
TRACE_ENABLED
public static final SystemProperty<Boolean> TRACE_ENABLED
-
LOG_TRACE_ENABLED
@Deprecated public static final String LOG_TRACE_ENABLED
Deprecated.in favour ofTRACE_ENABLED
-
-
Method Detail
-
isErrorEnabled
@Deprecated public static boolean isErrorEnabled()
Deprecated.replaced byLogger.isErrorEnabled(). Functionality of this method is delegated there.- Returns:
trueif logging is enabed, otherwisefalse
-
isDebugEnabled
@Deprecated public static boolean isDebugEnabled()
Deprecated.replaced byLogger.isDebugEnabled(). Functionality of this method is delegated there.- Returns:
trueif logging is enabed, otherwisefalse
-
setDebugEnabled
public static void setDebugEnabled(boolean enabled)
-
setTraceEnabled
public static void setTraceEnabled(boolean enabled)
-
isInfoEnabled
@Deprecated public static boolean isInfoEnabled()
Deprecated.replaced byLogger.isInfoEnabled(). Functionality of this method is delegated there.- Returns:
trueif logging is enabed, otherwisefalse
-
isWarnEnabled
@Deprecated public static boolean isWarnEnabled()
Deprecated.replaced byLogger.isWarnEnabled(). Functionality of this method is delegated there.- Returns:
trueif logging is enabed, otherwisefalse
-
debug
@Deprecated public static void debug(String s)
Deprecated.replaced byLogger.debug(String). Functionality of this method is delegated there.- Parameters:
s- the string to log
-
debug
@Deprecated public static void debug(Throwable throwable)
Deprecated.replaced byLogger.debug(String, Throwable). Functionality of this method is delegated there.- Parameters:
throwable- the throwable to log
-
debug
@Deprecated public static void debug(String s, Throwable throwable)
Deprecated.replaced byLogger.debug(String, Throwable). Functionality of this method is delegated there.- Parameters:
s- the string to logthrowable- the throwable to log
-
markDebugLogFile
public static void markDebugLogFile(String username)
-
rotateDebugLogFile
public static void rotateDebugLogFile()
-
info
@Deprecated public static void info(String s)
Deprecated.replaced byLogger.info(String). Functionality of this method is delegated there.- Parameters:
s- the string to log
-
info
@Deprecated public static void info(Throwable throwable)
Deprecated.replaced byLogger.info(String, Throwable). Functionality of this method is delegated there.- Parameters:
throwable- the throwable to log
-
info
@Deprecated public static void info(String s, Throwable throwable)
Deprecated.replaced byLogger.info(String, Throwable). Functionality of this method is delegated there.- Parameters:
s- the string to logthrowable- the throwable to log
-
markInfoLogFile
public static void markInfoLogFile(String username)
-
rotateInfoLogFile
public static void rotateInfoLogFile()
-
warn
@Deprecated public static void warn(String s)
Deprecated.replaced byLogger.warn(String). Functionality of this method is delegated there.- Parameters:
s- the string to log
-
warn
@Deprecated public static void warn(Throwable throwable)
Deprecated.replaced byLogger.warn(String, Throwable). Functionality of this method is delegated there.- Parameters:
throwable- the throwable to log
-
warn
@Deprecated public static void warn(String s, Throwable throwable)
Deprecated.replaced byLogger.debug(String, Throwable). Functionality of this method is delegated there.- Parameters:
s- the string to logthrowable- the throwable to log
-
markWarnLogFile
public static void markWarnLogFile(String username)
-
rotateWarnLogFile
public static void rotateWarnLogFile()
-
error
@Deprecated public static void error(String s)
Deprecated.replaced byLogger.error(String). Functionality of this method is delegated there.- Parameters:
s- the string to log
-
error
@Deprecated public static void error(Throwable throwable)
Deprecated.replaced byLogger.error(String, Throwable). Functionality of this method is delegated there.- Parameters:
throwable- the throwable to log
-
error
@Deprecated public static void error(String s, Throwable throwable)
Deprecated.replaced byLogger.error(String, Throwable). Functionality of this method is delegated there.- Parameters:
s- the string to logthrowable- the throwable to log
-
markErrorLogFile
public static void markErrorLogFile(String username)
-
rotateErrorLogFile
public static void rotateErrorLogFile()
-
rotateAllLogFile
public static void rotateAllLogFile()
-
getLogDirectory
public static String getLogDirectory()
Returns the directory that log files exist in. The directory name will have a File.separator as the last character in the string.- Returns:
- the directory that log files exist in.
-
-