Frontend Log Service

The Frontend Log Service writes and allows client-side JavaScript console output to be written to the backend. The BPC provides a prebuilt Process Monitor for querying the entries.

The Frontend Log Service offers the following features:

  • Creates the OpenSearch index 'BPC-frontend-logging' during initialization.

  • The Frontend Log Service can be enabled, disabled, or toggled via the Core Configuration’s Frontend Logging setting. By default, frontend logging is enabled.

  • The log level can be controlled via the Core Configuration setting “Frontend Log Level.” For example, if the log level is set to 'info' and there is a method call anywhere in the application for the JavaScript methods console.error, console.warn, or console.info, the arguments passed to these methods are logged by the backend. By default, the log level is set to 'warn'.

Frontend log data

Field Content

timestampUTC

The timestamp when the client log was sent

level

Debug, Log, Info, Warning, Error

message

Content of the console output

sessionId

Session ID of the current user session

Data Cleanup

Since the Frontend Log Service may generate large amounts of data, periodic data cleanup takes place. By default, entries older than 4 weeks are deleted. This can be configured via two settings in the configuration file <KARAF-INSTALL-DIR>/etc/de.virtimo.bpc.core.cfg.

...
de.virtimo.bpc.core.frontendlogging.cleanupPeriodInMinutes=60
de.virtimo.bpc.core.frontendlogging.deleteEntriesOlderThan=1 year ago
...
Example: Every 60 minutes, entries older than 1 year are deleted

Deletion only occurs if both settings are configured. Other useful values for 'deleteEntriesOlderThan': 14 days ago, 3 weeks ago, 1 month ago, 3 months ago, 6 years ago

Endpoint

Method Endpoint

/cxf/bpc-core/frontendLogging/{sessionId}

Description

Saves the logs provided in the body to the OpenSearch index bpc-frontend-logging.

Path Parameter

sessionId

the id of the session

Returns

HTTP Status Code

  • 200 : OK

Required Access Rights

A logged in user, API Key or access token is required.


Keywords: