Class SystemSupportLoggerAdapter
java.lang.Object
org.broadleafcommerce.common.logging.AbstractSupportLoggerAdapter
org.broadleafcommerce.common.logging.SystemSupportLoggerAdapter
- All Implemented Interfaces:
SupportLoggerAdapter
public class SystemSupportLoggerAdapter
extends AbstractSupportLoggerAdapter
implements SupportLoggerAdapter
Default Implementation of SupportLoggerAdapter that sends all support log messages to the console (System.out).
The following System Properties are supported to configure the behavior of this logger:
SystemSupportLoggerAdapter.showDateTime- Set totrueif you want the current date and time to be included in output messages. Default istrueSystemSupportLoggerAdapter.dateTimeFormat- The date and time format to be used in the output messages. The pattern describing the date and time format is defined bySimpleDateFormat. If the format is not specified or is invalid, the number of milliseconds since start up will be output.SystemSupportLoggerAdapter.showThreadName- Set totrueif you want to output the current thread name. Defaults tofalse.SystemSupportLoggerAdapter.showLogName- Set totrueif you want the Logger instance name to be included in output messages. Defaults totrue.SystemSupportLoggerAdapter.levelInBrackets- Should the level string be output in brackets? Defaults totrue.SystemSupportLoggerAdapter.showNonSupportLevels- Show non-support level logs (i.e. DEBUG, ERROR, FATAL, INFO, WARN) Defaults tofalse.
This implementation is heavily inspired by SLF4J's SimpleLogger.
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.broadleafcommerce.common.logging.AbstractSupportLoggerAdapter
DEBUG, ERROR, FATAL, INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_SUPPORT, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, SUPPORT, TRACE, WARN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidIn order to be backwards compatible.voidvoidvoidvoidvoidprotected DateFormatprotected Stringprotected booleangetName()protected booleanprotected booleanprotected booleanprotected booleanvoidvoidvoidlifecycle(LifeCycleEvent lifeCycleEvent, String message) Generate a specialized SUPPORT level log message that includes a LifeCycleEvent in the message.protected voidvoidvoidGenerate a SUPPORT level log messagevoidGenerate a SUPPORT level log message with an accompanying Throwablevoidvoidprotected voidwrite(StringBuffer buf, Throwable t)
-
Field Details
-
SHOW_DATE_TIME_KEY
- See Also:
-
DATE_TIME_FORMAT_KEY
- See Also:
-
SHOW_THREAD_NAME_KEY
- See Also:
-
SHOW_LOG_NAME_KEY
- See Also:
-
LEVEL_IN_BRACKETS_KEY
- See Also:
-
SHOW_NON_SUPPORT_LEVELS_KEY
- See Also:
-
-
Constructor Details
-
SystemSupportLoggerAdapter
public SystemSupportLoggerAdapter()
-
-
Method Details
-
support
Generate a SUPPORT level log message- Specified by:
supportin interfaceSupportLoggerAdapter- Parameters:
message- the log message
-
support
Generate a SUPPORT level log message with an accompanying Throwable- Specified by:
supportin interfaceSupportLoggerAdapter- Parameters:
message- the log messaget- the exception to accompany the log message - will result in a stack track in the log
-
lifecycle
Generate a specialized SUPPORT level log message that includes a LifeCycleEvent in the message.- Specified by:
lifecyclein interfaceSupportLoggerAdapter- Parameters:
lifeCycleEvent- The module life cycle type for this log messagemessage- the log message
-
debug
Description copied from interface:SupportLoggerAdapterIn order to be backwards compatible. The support logger should also support the debug, error, fatal, info, and warn levels as well.- Specified by:
debugin interfaceSupportLoggerAdapter
-
debug
- Specified by:
debugin interfaceSupportLoggerAdapter
-
error
- Specified by:
errorin interfaceSupportLoggerAdapter
-
error
- Specified by:
errorin interfaceSupportLoggerAdapter
-
fatal
- Specified by:
fatalin interfaceSupportLoggerAdapter
-
fatal
- Specified by:
fatalin interfaceSupportLoggerAdapter
-
info
- Specified by:
infoin interfaceSupportLoggerAdapter
-
info
- Specified by:
infoin interfaceSupportLoggerAdapter
-
warn
- Specified by:
warnin interfaceSupportLoggerAdapter
-
warn
- Specified by:
warnin interfaceSupportLoggerAdapter
-
log
-
write
-
getFormattedDate
-
getShowDateTime
protected boolean getShowDateTime() -
getDateFormatter
-
getShowThreadName
protected boolean getShowThreadName() -
getShowLogName
protected boolean getShowLogName() -
getLevelInBrackets
protected boolean getLevelInBrackets() -
getShowNonSupportLevels
protected boolean getShowNonSupportLevels() -
getName
- Specified by:
getNamein interfaceSupportLoggerAdapter
-
setName
- Specified by:
setNamein interfaceSupportLoggerAdapter
-