-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logs in other formats #95
Comments
well, i'd like to consider
|
I recently started using docker and centralized log collection systems. I do not have considerable expertise, but there are some observations. In practice I noticed that for example Traefik has a switch for log format (common/json) . I use Seq to collect logs from Docker containers. As far as I understand, the application itself doesn't need to support GELF or other ways to send logs to the collectors (transport layer). The application only needs to encode its messages as a JSON string with some predefined keys (importance level, message header). For example, in PHP I can easily generate an array of any nested information I want. And then I add two additional predefined fields (according to the CLEF specification):
Then I just encode the array before outputting it to JSON. In the log collector interface the messages received in JSON format are automatically converted into structured data with the possibility of expansion, filtering, alerts, etc. |
There is also python-json-logger. |
okay, given that there are many log formats of interest now and in the future, the only feasible way is a plugin-based approach. if anyone is seriously interested to implement this, let me know so i can provide general pointers for the endeavor. |
Is it possible to logging in JSON format (like GELF format)?
To have a more meaningful structured data in tools like Seq, Graylog, Logstash, Fluentd...
The text was updated successfully, but these errors were encountered: