This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
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.
What is the current behavior you want to change?
Add support for structured logging in the JSON CEE format.
This makes it much easier to load the logs into tools like OpenSearch.
This makes it much easier to combine logs from multiple application servers (media, SIP, XMPP, TURN, web servers) and merge the logs from all processes with events in time order.
I contributed similar patches for reSIProcate and GStreamer already, it is well documented in the GStreamer pull request:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/847
resiprocate/resiprocate@d1df9ae
What is the new behavior provided by this change?
When the environment variable
GST_DEBUG_STRUCTURED=JSON_CEE
exists, each log line will be in JSON format, following the CEE conventions, like this:How has this been tested?
Tested with Kurento as daemon, validated the log files with
python -mjson.tool
Tested with Kurento in foreground, validated the output with
python -mjson.tool
Types of changes
When running as a daemon, the Boost log formatting function in main/logging.cpp is used. This doesn't depend on any change to GStreamer.
When running in the foreground, Kurento relies on the code in GStreamer to write and format the log lines. Therefore, I backported the change from GStreamer upstream for Kurento's GStreamer fork, I'll submit that pull request too.
Checklist