JSLogBuilder

Overview

Object for constructing log events before logging them. Instances of JSLogBuilder should only be created by calling one of the JSLogger methods that return a JSLogBuilder.

Methods Summarized

Methods Detailed

log()

Logs an event without adding a message. This can be useful in combination with withException(e) if no message is required.

Returns: void

Sample

var log = application.getLogger();
log.warn.withException(myException).log();

log(message, params)

Logs a message with or without parameters.

Parameters

  • Object message the message to log; the format depends on the message factory.

  • Array params parameters to the message.

Returns: void

Sample

var log = application.getLogger();
log.warn.log("some message {} {} {}", "with", "multiple", "arguments");

withException(exception)

Includes an exception in the log event.

Parameters

  • Object exception The exception to log.

Returns: JSLogBuilder the LogBuilder.

Sample

var log = application.getLogger();
log.warn.withException(myException).log("some message");

Last updated