Logger
1.6.5The 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;
APIobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
name | string | Name of the logger. |
||
version | string | Version of the Logging API. |
Methods
canPublishmethod
Signature
(level: string) => boolean
Parameters
Name | Type | Required | Description |
---|---|---|---|
level | string |
consoleLevelmethod
Signature
(level?: string) => string
Description
Sets or gets the current threshold level for writing to the console.
Parameters
Name | Type | Required | Description |
---|---|---|---|
level | string | Logger level. |
debugmethod
Signature
(message: string) => void
Description
Method for logging messages at "debug" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
errormethod
Signature
(message: string) => void
Description
Method for logging messages at "error" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
infomethod
Signature
(message: string) => void
Description
Method for logging messages at "info" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
logmethod
Signature
(message: string, level?: string) => void
Description
Logging method.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
|
level | string | Logging level for the message. |
metricsLevelmethod
publishLevelmethod
Signature
(level?: string) => string
Description
Sets or gets the current threshold level for publishing to a file.
Parameters
Name | Type | Required | Description |
---|---|---|---|
level | string | Logger level. |
subLoggermethod
Signature
(name: string) => API
Description
Creates a new logger which is a sub-logger of the current one.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | Name for the sub-logger. |
tracemethod
Signature
(message: string) => void
Description
Method for logging messages at "trace" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
warnmethod
Signature
(message: string) => void
Description
Method for logging messages at "warn" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |