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.0captures everything, lower values sample.detections(array): Which automated checks to run, such asHALLUCINATIONorDOCUMENT_RELEVANCY.detection_sample_rate(float): Sampling rate for detections specifically. Defaults to0.0(disabled).
Tips
- Call
logger.initonce 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
tagsfor metadata you want on every log (e.g., team, product surface).
Next: Send Logs