Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
To enable elastic search logging you need to add the following in the toml file
Authentication
Configuration Options
type"standard""standard"(console) or"elasticsearch"enabledfalsehosts"localhost:9200"index_prefix"jac-scale"{prefix}-YYYY.MM.DD)username""password""api_key""bulk_size100Authentication Priority
When multiple auth methods are configured:
Log Structure
Each log entry is automatically enriched:
{ "@timestamp": "2024-01-29T10:15:30.123Z", "level": "ERROR", "message": "Payment processing failed", "pod_name": "jac-scale-api-7d4f-abc", "namespace": "production", "service_name": "jac-scale-api", "user_id": 123, "transaction_id": "txn-789", "amount": 99.99, "error_code": "INSUFFICIENT_FUNDS" }Fields automatically added:
@timestamp- ISO 8601 timestamplevel- Log level (INFO, ERROR, WARN, DEBUG)message- Your log messagepod_name- From$HOSTNAMEenv var (Kubernetes pod name)namespace- From$POD_NAMESPACEenv varservice_name- From$SERVICE_NAMEenv varPlus any custom fields you provide in the context dict.