You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: There are many different contexts that we need to log along with basic log message
### Issue with current implementation
At BajaBikes, we used glg to log app executions in many different contexts:
- User, admin, demon execution processes
- lambda, cube, local
- dev, staging, production
Some of that contexts, e.g. last one, could implemented by separate logging endpoints and\or writers
But others should be added to log as part of the logging.
E.g. [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/index.html)
has a rich schema that can complete log context in many ways.
### Applicable Solution
Use json format only for one (LogstashWriter) writer
In writer before send our logs we can Unmarshal log, add contexts and then Marshal it back.
We can use json format only for all writers all together, that is not trully readable (e.g. for a console)
Another solution will be allow add context to log somehow, or allow define custom structure for a logs,
but I can't imagine an implementation for now.
### Alternative solution
For now, we are using text format, that we parse in writer by regular expresion, complete structure with contexts,
marshal it and send to the logstash.
It's fine for now, but maybe you can get sugestions to make more powerful architecture
The text was updated successfully, but these errors were encountered:
🚀Log the context
Description: There are many different contexts that we need to log along with basic log message
The text was updated successfully, but these errors were encountered: