Kurento / bugtracker

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento
46 stars 10 forks source link

KMS logs different time depending on log mode #545

Open j1elo opened 3 years ago

j1elo commented 3 years ago

Prerequisites

Issue description

By default, KMS uses the default log handler function from GStreamer: https://gstreamer.freedesktop.org/documentation/gstreamer/gstinfo.html#gst_debug_log_default

this will print a timestamp reflecting the time since the process was started, as explained here: https://gstreamer.freedesktop.org/documentation/tutorials/basic/debugging-tools.html

however, when enabling the output to files (with --logs-path), the logging backend is changed to Boost, which prints the current system time.

This issue is a improvement request, to always print the current system time, regardless of what is the selected logging mode / backend.

Context

Running KMS either directly by calling /usr/bin/kurento-media-server, or exec as PID 1 in the Kurento Docker container, vs. running KMS as a system service.

How to reproduce?

Expected & current behavior

Example of log shown with the Boost logger (--logs-path option enabled):

2020-10-29T16:54:56,556406 7616 0x00007f20b5e7d240    info KurentoMediaServer        main.cpp:259 main()  Kurento Media Server started

Example of log shown with default GStreamer logger (--logs-path option not used / disabled):

0:00:00.326942137  7479 0x55822aaa0d50 INFO      KurentoMediaServer main.cpp:258:main: Kurento Media Server started

Expected log with --logs-path option not used / disabled:

2020-10-29T16:54:56,556406  7479 0x55822aaa0d50 INFO      KurentoMediaServer main.cpp:258:main: Kurento Media Server started

(Optional) Possible solution

It is not possible to configure the GStreamer logger, as a quick read of the code shows that the "time since start" is hardcoded:

So the remaining alternative is to redirect all GStreamer logs through Boost, and in there it would be possible to print the correct system time in the final log line.

INFO about Kurento Media Server

github-actions[bot] commented 3 years ago

Hello @j1elo! :wave: we're sorry you found a bug... so first of all, thank you very much for reporting it.

To know about progress, check in Triage. All issues are considered Backlog Candidates until work priorities align and the issue is selected for development. It will then become part of our official Backlog.

hailongfeng commented 3 years ago

I also encountered this problem, please j1elo can solve it in the next version, thank you very much