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 totrue
if you want the current date and time to be included in output messages. Default istrue
SystemSupportLoggerAdapter.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 totrue
if you want to output the current thread name. Defaults tofalse
.SystemSupportLoggerAdapter.showLogName
- Set totrue
if 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 String
static final String
static final String
static final String
static final String
static final String
Fields 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 TypeMethodDescriptionvoid
In order to be backwards compatible.void
void
void
void
void
protected DateFormat
protected String
protected boolean
getName()
protected boolean
protected boolean
protected boolean
protected boolean
void
void
void
lifecycle
(LifeCycleEvent lifeCycleEvent, String message) Generate a specialized SUPPORT level log message that includes a LifeCycleEvent in the message.protected void
void
void
Generate a SUPPORT level log messagevoid
Generate a SUPPORT level log message with an accompanying Throwablevoid
void
protected void
write
(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:
support
in interfaceSupportLoggerAdapter
- Parameters:
message
- the log message
-
support
Generate a SUPPORT level log message with an accompanying Throwable- Specified by:
support
in 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:
lifecycle
in interfaceSupportLoggerAdapter
- Parameters:
lifeCycleEvent
- The module life cycle type for this log messagemessage
- the log message
-
debug
Description copied from interface:SupportLoggerAdapter
In order to be backwards compatible. The support logger should also support the debug, error, fatal, info, and warn levels as well.- Specified by:
debug
in interfaceSupportLoggerAdapter
-
debug
- Specified by:
debug
in interfaceSupportLoggerAdapter
-
error
- Specified by:
error
in interfaceSupportLoggerAdapter
-
error
- Specified by:
error
in interfaceSupportLoggerAdapter
-
fatal
- Specified by:
fatal
in interfaceSupportLoggerAdapter
-
fatal
- Specified by:
fatal
in interfaceSupportLoggerAdapter
-
info
- Specified by:
info
in interfaceSupportLoggerAdapter
-
info
- Specified by:
info
in interfaceSupportLoggerAdapter
-
warn
- Specified by:
warn
in interfaceSupportLoggerAdapter
-
warn
- Specified by:
warn
in 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:
getName
in interfaceSupportLoggerAdapter
-
setName
- Specified by:
setName
in interfaceSupportLoggerAdapter
-