Class comb.logging.appenders.Appender
Base class for all appenders
Defined in: appender.js.
Constructor Attributes | Constructor Name and Description |
---|---|
comb.logging.appenders.Appender(options)
|
Field Attributes | Field Name and Description |
---|---|
the level of this Appender.
|
|
the name of this Appender.
|
|
the pattern for this Appender.
|
Method Attributes | Method Name and Description |
---|---|
append(event, level, name, message)
Appends a message to a log.
|
Class Detail
comb.logging.appenders.Appender(options)
- Parameters:
- {Object} options Optional
- options to assign to this Appender
- {String} options.name Optional, Default: "appender"
- the name of this Appender. If you want two of the same type of appender on a logger it must have a different name.
- {String} options.pattern Optional, Default: "[{[yyyy-MM-ddTHH:mm:ss:SSS (z)]timeStamp}] {[- 5]levelName} {[-20]name} - {message}"
Available Options for formatting see comb.string.format for formatting options
- timeStamp - the timestamp of the event being logged
- level - the comb.logging.Level of the event
- levelName - the name of the level being logged
- name - the name of the logger logging the event
- message - the message being logged
- {comb.logging.Level|String} options.level Optional, Default: comb.logging.Level.INFO
- the logging level of this appender
Note: the level can be different from the logger in the case that you want a particular logger to only log particular event of a level. For example an appender that only logs errors. BEWARE that if the appenders level is lower than the logger is will not recieve any messages.
Field Detail
{comb.logging.Level}
level
the level of this Appender.
{String}
name
the name of this Appender.
{String}
pattern
the pattern for this Appender.
Method Detail
append(event, level, name, message)
Appends a message to a log.
This method is abstract and must be implemented in subclasses
- Parameters:
- {Object} event
- the logging event to log.
- {Date} event.timeStamp
- the timeStamp of the event.
- {comb.logging.Level} level
- the level of the event.
- {String} name
- the name of the logger the event was emitted from.
- {String} message
- the message that is being logged.