Logs

Logs

Plugins write Bunyan formated logs to separate log files. This class provides utilities for viewing and following those logs as they're written.

Constructor

new Logs(baseURLopt)

Description:
  • Instantiate a Log Object

Source:
Parameters:
Name Type Attributes Description
baseURL string <optional>

Protocol, domain, and port for the service.

Classes

Logs

Methods

end()

Description:
  • End the log stream and stop following logs.

Source:

follow(plugins, level, callback)

Description:
  • Add a handler for following logs. Note that each invocation of this method opens a connection to the server and holds it open. Web browsers limit the number of connections to a single domain. Avoid using this method more than once per client.

Source:
Parameters:
Name Type Description
plugins Array.<string>

Follow logs for the provided Plugin IDs.

level string | number

Log Level.

callback function

Invoked with two arguments. The first argument is an Error object (if an error occurred) or null. The second argument is an log object.