Frontend Log Service
Client-side Javascript console outputs are and can be written to the backend via the Frontend Log Service. The BPC provides a ready-made Process monitor to query the entries.
The Frontend Log Service offers the following functionalities:
-
Creates the Opensearch index 'bpc-frontend-logging' during initialization.
-
The Frontend Log Service can be activated via the core configuration Activate frontend logging Frontend logging is activated by default.
-
The log level can be set via the core configuration Frontend Log Level the log level can be controlled via the core configuration frontend log level. For example, if the log level is set to 'info' and there is a method call for the Javascript methods
console.error,console.warnorconsole.infoanywhere in the application, the arguments that are passed to these methods are logged by the backend. The log level is set to 'warn' by default.
Data of a frontend log
| Field | Content |
|---|---|
timestampUTC |
The timestamp at which 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 cleansing
As the Frontend Log Service may generate large amounts of data, periodic data cleansing 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
...
The deletion is only carried out if both settings are set. 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. |