Skip to content
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

respect log level for all sources #16922

Merged
merged 2 commits into from Feb 5, 2024

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Feb 4, 2024

Summary

There are two things in the logging library that are not documented and I believe are not bugs, but are implemented for a reason:

  1. The default log level affects only the daemon and collector logs (nd_log_set_priority_level()).
  2. There is a way to set the log level per source, but again, the filtering affects only the daemon and collector logs (netdata_logger()).

I think I understand 1. - we don't want to filter health (alerts transitions) and access sources (web server access logs) if the global log level is < info. But I think we should respect the log levels of each source when explicitly set (2.).

The issue is reported on Discord.

This PR changes both 1 and 2: both global and individual log levels apply to all sources.

Test Plan

Set access log level, check logs.

Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 force-pushed the respect-log-level-all-sources branch from f8bb3f9 to fdfd158 Compare February 4, 2024 13:48
@ilyam8 ilyam8 changed the title respect log level for all sources if explicitly set respect log level for all sources Feb 4, 2024
@ilyam8
Copy link
Member Author

ilyam8 commented Feb 4, 2024

@stelfrag @ktsaou Do you think that health, access, and aclk are special sources and we need to treat them differently? Like they only can be enabled or disabled, and log-level filtering is not applicable for them?

If so, I will close this PR and just update the documentation. The only problem is that these special sources contain debug-level messages which can not be filtered.

@thiagoftsm
Copy link
Contributor

A quick update, while we are waiting some answers. On Slackware and FreeBSD logs are working as expected.

Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am considering the @stelfrag approve, the answer we were expecting, so LGTM!

@ilyam8 ilyam8 merged commit 85b2748 into netdata:master Feb 5, 2024
132 checks passed
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Feb 6, 2024
@stelfrag stelfrag mentioned this pull request Feb 6, 2024
tkatsoulas pushed a commit that referenced this pull request Feb 6, 2024
@ilyam8 ilyam8 deleted the respect-log-level-all-sources branch February 23, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants