Skip to content

Latest commit

 

History

History
254 lines (151 loc) · 8.33 KB

api.md

File metadata and controls

254 lines (151 loc) · 8.33 KB

Table of Contents

Logia

The Logia module. The returned value of require("logia").

Parameters

  • name string The logger name that we want to create/retrieve

Returns logger The newly created or retrieved logger instance

overwriteConfigFile

Overwrites the configuration file on disk if the "overwritable" option is set to true. NOOP when executing in the browser.

Parameters

setDateFormat

Sets the date format in the logs.

Parameters

config

Sets the global Logia configuration. It doesn't overwrite the configuration file on disk.

Parameters

enterSlaveMode

Enters slave mode. Logia configuration is dictated by the specified Logia master node.

Parameters

  • options object Logia master server location info.

exitSlaveMode

Exits slave mode. Logia configuration is based on local configuration file again.

enterMasterMode

Enters master mode. A master Logia node can command multiple slave nodes via the master node configuration mechanism.

Parameters

exitMasterMode

Exits master mode.

server.on

Listens for certain server events. Currently the only supported event is the "log" event which is triggered when Logia server receives a log.

Parameters

LogiaConfig

The Logia configuration object.

Properties

level

We can define n-number of logger-name regexp properties in level

Properties

  • logger_name_regexp string (fatal|error|warn|info|debug|trace).

appenders

We can define n-number of logger-name regexp properties in appenders

Properties

  • logger_name_regexp object {filepath: {string}, maxSize: {number}}

remotes

We can define n-number of logger-name regexp properties in remotes

Properties

  • logger_name_regexp object {protocol: {string}, url: {string}}

mode

Run Logia either as a master or slave instance

Properties

logger

Logia logger instance.

Parameters

  • name

warn

Log in warn level

Parameters

  • text string It can be parameterized by using "{0}".."{n}" placeholders
  • parameters ...any n-th parameter replaces "{n}" placeholder in log text

info

Log in info level

Parameters

  • text string It can be parameterized by using "{0}".."{n}" placeholders
  • parameters ...any n-th parameter replaces "{n}" placeholder in log text

trace

Log in trace level

Parameters

  • text string It can be parameterized by using "{0}".."{n}" placeholders
  • parameters ...any n-th parameter replaces "{n}" placeholder in log text

error

Log in error level

Parameters

  • text string It can be parameterized by using "{0}".."{n}" placeholders
  • parameters ...any n-th parameter replaces "{n}" placeholder in log text

fatal

Log in fatal level

Parameters

  • text string It can be parameterized by using "{0}".."{n}" placeholders
  • parameters ...any n-th parameter replaces "{n}" placeholder in log text

debug

Log in debug level

Parameters

  • text string It can be parameterized by using "{0}".."{n}" placeholders
  • parameters ...any n-th parameter replaces "{n}" placeholder in log text

stdout

Enables/disables stdout of logger

Parameters

Returns logger

setLevel

Sets logger level

Parameters

Returns logger

setAppender

Sets logger file appender

Parameters

Returns logger

setRemote

Sets loggers remote

Parameters

Returns logger