Logger

4.7.1

The Glue42 Logging API enables JavaScript applications to create a hierarchy of sub-loggers mapped to application components where you can control the level of logging for each component. You can also route the output of log messages (depending on the logging level) to a variety of targets:

  • the developer console;
  • an external output - usually a rolling file on the desktop, but actually any target the log4net library supports;
  • the Glue42 Desktop Metrics bus;
  • the Glue42 Notification Service;

The last three targets give you the ability to:

  • connect to a remote desktop and pull the application log files using the Interop Viewer;
  • connect to the Metrics bus and monitor the application in real time, or record log messages routed to a metrics storage in a Cassandra database for later analysis;
  • raise notifications which can be displayed via a customizable UI on the user’s desktop;

object

methodsubLogger
(name: string) => API

Description

Creates a new logger which is a sub-logger of the current one.

Parameters

Name
Type
Required
Description

name

string

yes

Name for the sub-logger.

Returns

API

(level: string) => string

Description

Sets or gets the current threshold level for publishing to a file.

Parameters

Name
Type
Required
Description

level

string

no

Logger level.

Returns

string

(level: string) => string

Description

Sets or gets the current threshold level for writing to the console.

Parameters

Name
Type
Required
Description

level

string

no

Logger level.

Returns

string

(level: string, metricsSystem: System) => string

Description

Sets or gets the current threshold level for publishing metrics.

Parameters

Name
Type
Required
Description

level

string

no

Logger level.

metricsSystem

no

Metrics system for which to set the logging level.

Returns

string

methodlog
(message: string, level: string) => void

Description

Logging method.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

level

string

no

Logging level for the message.

Returns

void

methodtrace
(message: string) => void

Description

Method for logging messages at “trace” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methoddebug
(message: string) => void

Description

Method for logging messages at “debug” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methodinfo
(message: string) => void

Description

Method for logging messages at “info” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methodwarn
(message: string) => void

Description

Method for logging messages at “warn” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methoderror
(message: string) => void

Description

Method for logging messages at “error” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methodcanPublish
(level: string) => boolean

Parameters

Name
Type
Required
Description

level

string

yes

Returns

boolean

Properties

string

Name of the logger.

string

Version of the Logging API.