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' upon initialization.
-
The Frontend Log Service can be enabled, disabled, or set to active via the Core Configuration > 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, orconsole.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]/etc/de.virtimo.bpc.core.cfg.
...
de.virtimo.bpc.core.frontendlogging.cleanupPeriodInMinutes=60
de.virtimo.bpc.core.frontendlogging.deleteEntriesOlderThan=1 year ago
...
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 |
|---|---|
|
|
Description Saves the logs provided in the body to the OpenSearch index |
|
Path Parameter
|
|
Returns HTTP Status Code
|
|
Required Access Rights A logged-in user or API key is required. |