mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
* add audit factory skeleton * add additional audit events * add more audit logs * delete account join request when redeeming an invite * add audit event for account request removed * wip api to fetch audits * add check for audit with public access and entitlement * fix issues with merge * add docs for audit logs * add proper audit log for audit fetch and proper handling of api key hash in audit * format nit * feedback
40 lines
No EOL
1.3 KiB
Text
40 lines
No EOL
1.3 KiB
Text
---
|
|
title: Structured Logging
|
|
sidebarTitle: Structured logging
|
|
---
|
|
|
|
By default, Sourcebot will output logs to the console in a human readable format. If you'd like Sourcebot to output structured JSON logs, set the following env vars:
|
|
|
|
- `SOURCEBOT_STRUCTURED_LOGGING_ENABLED` (default: `false`): Controls whether logs are in a structured JSON format
|
|
- `SOURCEBOT_STRUCTURED_LOGGING_FILE`: If structured logging is enabled and this env var is set, structured logs will be written to this file (ex. `/data/sourcebot.log`)
|
|
|
|
### Structured log schema
|
|
```json
|
|
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"type": "object",
|
|
"title": "SourcebotLog",
|
|
"properties": {
|
|
"level": {
|
|
"type": "string",
|
|
"description": "The log level (error, warning, info, debug)"
|
|
},
|
|
"service": {
|
|
"type": "string",
|
|
"description": "The Sourcebot component that generated the log"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "The log message"
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"description": "The same value as the level field added for datadog support"
|
|
},
|
|
"timestamp": {
|
|
"type": "string",
|
|
"description": "The timestamp of the log in ISO 8061 format"
|
|
}
|
|
}
|
|
}
|
|
``` |