ZEST / base.logger / Module: base-logger/appenders/file

base-logger/appenders/file

require("base-logger/appenders/file")(group, pattern, appenderOptions) → {module:base-logger~LoggerBase}

This function returns a logger which logs a decorated message in a file.

Parameters:
Name Type Argument Description
group String

the name of the group for which the logger should be returned

pattern string | module:base-logger~LogPattern <optional>

the pattern used for formatting the logs. If the value is a string, the same pattern will be used for logging debug, info, warn and error messages. See module:base-logger~LogPattern for details on how patterns are used.

appenderOptions module:base-logger/appenders/file~AppenderOptions

the options used to configure the file appender

Source:
Returns:

an object with debug, info, warn and error functions.

Type
module:base-logger~LoggerBase

file appender is used by the logger to log messages in a file

Source:

Requires

Type Definitions

AppenderOptions

Properties:
Name Type Argument Description
path string

which is the path to the file where the logs should be saved. The path should be without extension.

roll string <optional>

if used, defines when new log files should be created and how it should be rolled. roll can be any momentjs date format. the file name of log files will be appended with the time formated in the specified format and whenever the parsed value changes, a new log file will be created.

For example,

a value of YYYYM will create one file for each month.

For Jan 2015, the filename will be <<value of path>>-20151.log.

Source: