Class Index | File Index

Classes


Class comb.logging.appenders.RollingFileAppender


Extends comb.logging.appenders.FileAppender.
Appends messages to a file. Rolls files over when a size limit has been reached. Once the max file size has been reached it is rolled over to a file called .log.n where n is a number.

Example. RollingFileAppender is current writing to myLog.log, the log reaches is max size to it is renamed to myLog.log.1 and a new myLog.log is created.

If maxBackupIndex is reached then the log at that index is deleted. If maxBackupIndex is set to 0 then no log is rolled over.


Defined in: rollingFileAppender.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Fields borrowed from class comb.logging.appenders.Appender:
level, name, pattern
Methods borrowed from class comb.logging.appenders.Appender:
append
Class Detail
comb.logging.appenders.RollingFileAppender(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.

{String} options.file Optional, Default: "./log.log"
the file to log events to.
{String} options.encoding Optional, Default: "utf8"
the encoding of the file.
{Boolean} options.overwrite Optional, Default: false
if true the log file is overwritten otherwise it is appended to.
{String} options.maxSize Optional, Default: "10MB"
the maxSize of a file. Valid options include "KB", "MB", or "GB"
    maxSize = "100MB"
    //or
    maxSize = "100KB"
    //or
    maxSize = "1GB"
{Number} options.maxBackupIndex Optional, Default: 10
the maximum number of files to rollOver.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 13:20:07 GMT-0500 (CDT)