Basic Initialization
Key Parameters
app_name
(string): Logical application name. Used as the primary grouping dimension in the dashboard.environment
(string): Where the app is running (dev
,staging
,prod
, etc.). Drives environment filters.tags
(object, optional): Default metadata applied to every log (e.g.,{ "team": "growth" }
).sample_rate
(float): Percentage of logs to persist.1.0
captures everything, lower values sample.detections
(array): Which automated checks to run, such asHALLUCINATION
orDOCUMENT_RELEVANCY
.detection_sample_rate
(float): Sampling rate for detections specifically. Defaults to0.0
(disabled).
Tips
- Call
logger.init
once during application startup; repeated calls reuse the same configuration. - Use configuration files or environment variables to keep app name and environment consistent across deploys.
- Provide
tags
for metadata you want on every log (e.g., team, product surface).
Next: Send Logs