org.xwiki.component.logging
Interface Logger

All Known Implementing Classes:
VoidLogger

public interface Logger

Logger component, used for logging messages. Classes that want to log should not declare a dependency on this component, but implement the LogEnabled interface. A quick way to enable logging is to extend AbstractLogEnabled.

Version:
$Id: Logger.java 35142 2011-03-04 14:48:52Z vmassol $

Method Summary
 void debug(java.lang.String message)
          Log a message with the debug priority.
 void debug(java.lang.String message, java.lang.Object... objects)
           Logs the message to the logger with debug priority while expanding the message with the objects passed.
 void debug(java.lang.String message, java.lang.Throwable throwable)
          Log a message with the debug priority, also printing the exception that caused this message, along with its stack trace.
 void debug(java.lang.String message, java.lang.Throwable throwable, java.lang.Object... objects)
           Logs the message to the logger with debug priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace.
 void error(java.lang.String message)
          Log a message with the error priority.
 void error(java.lang.String message, java.lang.Object... objects)
           Logs the message to the logger with error priority while expanding the message with the objects passed.
 void error(java.lang.String message, java.lang.Throwable throwable)
          Log a message with the error priority, also printing the exception that caused this message, along with its stack trace.
 void error(java.lang.String message, java.lang.Throwable throwable, java.lang.Object... objects)
           Logs the message to the logger with error priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace.
 void info(java.lang.String message)
          Log a message with the info priority.
 void info(java.lang.String message, java.lang.Object... objects)
           Logs the message to the logger with info priority while expanding the message with the objects passed.
 void info(java.lang.String message, java.lang.Throwable throwable)
          Log a message with the info priority, also printing the exception that caused this message, along with its stack trace.
 void info(java.lang.String message, java.lang.Throwable throwable, java.lang.Object... objects)
           Logs the message to the logger with info priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace.
 boolean isDebugEnabled()
          Check if the debug priority is enabled.
 boolean isErrorEnabled()
          Check if the error priority is enabled.
 boolean isInfoEnabled()
          Check if the info priority is enabled.
 boolean isWarnEnabled()
          Check if the warn priority is enabled.
 void warn(java.lang.String message)
          Log a message with the warn priority.
 void warn(java.lang.String message, java.lang.Object... objects)
           Logs the message to the logger with warn priority while expanding the message with the objects passed.
 void warn(java.lang.String message, java.lang.Throwable throwable)
          Log a message with the warn priority, also printing the exception that caused this message, along with its stack trace.
 void warn(java.lang.String message, java.lang.Throwable throwable, java.lang.Object... objects)
           Logs the message to the logger with warn priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace.
 

Method Detail

debug

void debug(java.lang.String message)
Log a message with the debug priority.

Parameters:
message - The message to be logged. No further processing of the message is performed.

debug

void debug(java.lang.String message,
           java.lang.Throwable throwable)
Log a message with the debug priority, also printing the exception that caused this message, along with its stack trace.

Parameters:
message - The message to be logged. No further processing of the message is performed.
throwable - The exception associated with the message, for stack trace output.

debug

void debug(java.lang.String message,
           java.lang.Object... objects)

Logs the message to the logger with debug priority while expanding the message with the objects passed. The message uses the java.text.MessageFormat syntax.

Example: log.debug("Doc was created on {0} and was changed {1} times", date, 5); log.debug("There {0,choice,0#are|1#is|1<are} {0,choice,0#no|1#one|1<{0}} file{0,choice,0#s|1#|1<s}", nrFiles);

The logged message will only be formatted if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

debug

void debug(java.lang.String message,
           java.lang.Throwable throwable,
           java.lang.Object... objects)

Logs the message to the logger with debug priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace. The message uses the java.text.MessageFormat syntax.

Example: log.debug("Unhandled exception while executing the query [{0}]", exception, query);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
throwable - The exception associated with the message, for stack trace output.
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

isDebugEnabled

boolean isDebugEnabled()
Check if the debug priority is enabled.

Returns:
true if messages with debug priority will be logged, false otherwise

info

void info(java.lang.String message)
Log a message with the info priority.

Parameters:
message - The message to be logged. No further processing of the message is performed.

info

void info(java.lang.String message,
          java.lang.Throwable throwable)
Log a message with the info priority, also printing the exception that caused this message, along with its stack trace.

Parameters:
message - The message to be logged. No further processing of the message is performed.
throwable - The exception associated with the message, for stack trace output.

info

void info(java.lang.String message,
          java.lang.Object... objects)

Logs the message to the logger with info priority while expanding the message with the objects passed. The message uses the java.text.MessageFormat syntax.

Example: log.info("Doc was created on {0} and was changed {1} times", date, 5); log.info("There {0,choice,0#are|1#is|1<are} {0,choice,0#no|1#one|1<{0}} file{0,choice,0#s|1#|1<s}", nrFiles);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

info

void info(java.lang.String message,
          java.lang.Throwable throwable,
          java.lang.Object... objects)

Logs the message to the logger with info priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace. The message uses the java.text.MessageFormat syntax.

Example: log.info("Unhandled exception while executing the query [{0}]", exception, query);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
throwable - The exception associated with the message, for stack trace output.
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

isInfoEnabled

boolean isInfoEnabled()
Check if the info priority is enabled.

Returns:
true if messages with info priority will be logged, false otherwise

warn

void warn(java.lang.String message)
Log a message with the warn priority.

Parameters:
message - The message to be logged. No further processing of the message is performed.

warn

void warn(java.lang.String message,
          java.lang.Throwable throwable)
Log a message with the warn priority, also printing the exception that caused this message, along with its stack trace.

Parameters:
message - The message to be logged. No further processing of the message is performed.
throwable - The exception associated with the message, for stack trace output.

warn

void warn(java.lang.String message,
          java.lang.Object... objects)

Logs the message to the logger with warn priority while expanding the message with the objects passed. The message uses the java.text.MessageFormat syntax.

Example: log.warn("Doc was created on {0} and was changed {1} times", date, 5); log.warn("There {0,choice,0#are|1#is|1<are} {0,choice,0#no|1#one|1<{0}} file{0,choice,0#s|1#|1<s}", nrFiles);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

warn

void warn(java.lang.String message,
          java.lang.Throwable throwable,
          java.lang.Object... objects)

Logs the message to the logger with warn priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace. The message uses the java.text.MessageFormat syntax.

Example: log.warn("Unhandled exception while executing the query [{0}]", exception, query);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
throwable - The exception associated with the message, for stack trace output.
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

isWarnEnabled

boolean isWarnEnabled()
Check if the warn priority is enabled.

Returns:
true if messages with warn priority will be logged, false otherwise

error

void error(java.lang.String message)
Log a message with the error priority.

Parameters:
message - The message to be logged. No further processing of the message is performed.

error

void error(java.lang.String message,
           java.lang.Throwable throwable)
Log a message with the error priority, also printing the exception that caused this message, along with its stack trace.

Parameters:
message - The message to be logged. No further processing of the message is performed.
throwable - The exception associated with the message, for stack trace output.

error

void error(java.lang.String message,
           java.lang.Object... objects)

Logs the message to the logger with error priority while expanding the message with the objects passed. The message uses the java.text.MessageFormat syntax.

Example: log.error("Doc was created on {0} and was changed {1} times", date, 5); log.error("There {0,choice,0#are|1#is|1<are} {0,choice,0#no|1#one|1<{0}} file{0,choice,0#s|1#|1<s}", nrFiles);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

error

void error(java.lang.String message,
           java.lang.Throwable throwable,
           java.lang.Object... objects)

Logs the message to the logger with error priority while expanding the message with the objects passed, also printing the exception that caused this message, along with its stack trace. The message uses the java.text.MessageFormat syntax.

Example: log.error("Unhandled exception while executing the query [{0}]", exception, query);

The logged message will only be assembled if the message is actually logged.

Parameters:
message - The message to be formatted via java.text.MessageFormat
throwable - The exception associated with the message, for stack trace output.
objects - The objects to be filled into the message
See Also:
java.text.MessageFormat

isErrorEnabled

boolean isErrorEnabled()
Check if the error priority is enabled.

Returns:
true if messages with error priority will be logged, false otherwise


Copyright © 2004-2011 XWiki. All Rights Reserved.