-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Log: Should follow Java/Go/FFmpeg/NGINX log level specs. #3218
Labels
EnglishNative
This issue is conveyed exclusively in English.
Enhancement
Improvement or enhancement.
Milestone
Comments
winlinvip
changed the title
Log: Follow log level specs.
Log: Should follow Java/Go/FFmpeg log level specs.
Oct 25, 2022
winlinvip
added a commit
to winlinvip/srs
that referenced
this issue
Oct 26, 2022
winlinvip
changed the title
Log: Should follow Java/Go/FFmpeg log level specs.
Log: Should follow Java/Go/FFmpeg/NGINX log level specs.
Oct 26, 2022
winlinvip
added a commit
to winlinvip/srs
that referenced
this issue
Oct 26, 2022
winlinvip
added a commit
to winlinvip/srs
that referenced
this issue
Oct 26, 2022
winlinvip
added a commit
that referenced
this issue
Oct 26, 2022
srs/trunk/src/kernel/srs_kernel_log.hpp Line 23 in 27f9db9
Why not redefine the
How about the below definition?
|
johzzy
pushed a commit
to johzzy/srs
that referenced
this issue
Jun 26, 2023
…s#3219) 1. Support Java/log4j log level text. 2. Support configuring by `--log-new-level=on` which is enabled by default. 3. Support `--log-new-level=off` to use SRS 4.0 log level for compatibility.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
EnglishNative
This issue is conveyed exclusively in English.
Enhancement
Improvement or enhancement.
The log level of SRS 1.0 to 4.0:
The Java log4j specs, see apache/logging-log4j2
The Go log specs, see golang/glog or kubernetes/klog:
For Go, another defactor log specs is uber-go/zap
While FFmpeg has a more detail log level specs:
The last one, NGXIN log level, see nginx:
SRS 5.0+ should follow Java/Go/FFmpeg/Nginx log level specs.
Config
The config for log level:
The default level of SRS 4.0:
srs_log_level trace;
The default level of SRS 5.0:
srs_log_level trace;
srs_log_level_v2 info;
The default config should work well without any changes.
Configure
SRS 5.0 supports configure options to control the log text for level:
If
./configure --log-level_v2=off
, use SRS 4.0 log level text, literally the same tosrs_log_level
, even though the config usesrs_log_level_v2
.If
./configure srs_log_level_v2=on
, use SRS 5.0 v2 log level text, apply both for the configsrs_log_level
andsrs_log_level_v2
.The config file and configure is orthogonal:
srs_log_level
orsrs_log_level_v2
control the converting from text to log level object.--log-level_v2=on|off
controls the log level text in each log line.So you're able to use different log level for both new style and keep compability with old style.
Compare
If config with
srs_log_level
, the log text is described by bellow table:srs_log_level
--log-level_v2=off
--log-level_v2=on
If config with
srs_log_level_v2
, the log text is described by bellow table:srs_log_level_v2
./configure
--log-level_v2=off
./configure
--log-level_v2=on
There is a full table about config and configure options:
srs_log_level
srs_log_level_v2
./configure
--log-level_v2=off
./configure
--log-level_v2=on
The default config should work well, so you don't have to change it.
Example
The startup log of SRS 4.0:
SRS. 5.0:
The text was updated successfully, but these errors were encountered: