#Enriching Logs in Baselime
Baselime enables you to enrich your logs with special fields to enable deeper insights into your application's performance and traceability.
The available fields are:
requestId
duration
traceId
error
namespace
service
You can add those fields to your logs to enable the Requests view in Baselime.
Baselime automatically adds those fields to logs coming from cloud services with deep integrations such as AWS Lambda, Vercel and Cloudflare Workers.
#Grouping your logs by request
Baselime enables you to group your logs by request by adding a requestId
field to all the logs and events within the same request.
In an Express.js server:
You can leverage your favourite logger to automatically add the requestId
field to all the logs within a single request.
In addition to HTTP requests, you can use the requestId
field to group logs for any task, such as background jobs or build processes.
#Measuring Request Duration
Add the duration
field to at least one log or event from a request to measure its duration and enable analytics on request durations in Baselime.
For example, in an Express.js server:
#Capturing errors in your events
Add the error
field to any event where an error occured in your application. The value of the error field must be a string. Any event with the error
field will be captured by the Baselime automatic error-tracking.
For example:
#Grouping logs by namespace or path
Baselime enables you to group your logs by namespace or path by adding a namespace
field to at least one log from a given request.
In an Express.js server:
#Grouping logs by service
Baselime enables you to group your logs by service by adding a service
field to all logs from the same service.
For example:
#Correlating logs and traces
Refer to the Correlate Logs with Traces section.
#Usage
Once you have enriched your logs with the additional fields, your data will show in Baselime in the Requests view.
