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

[YAML] 'log_level' is deprecated parameter name. use '@log_level' instead // parameter '$log_level' is not used #4463

Closed
ng-bsy opened this issue Apr 11, 2024 · 3 comments · Fixed by #4482
Labels

Comments

@ng-bsy
Copy link

ng-bsy commented Apr 11, 2024

Describe the bug

log_level on plugin scope can't be correctly defined in yaml config, without fluentd throwing a warning and/or the parameter not being recognized

To Reproduce

# Config 1
- match:
    $tag: '**'
    $type: stdout
    log_level: debug

results in:

[warn]: #0 'log_level' is deprecated parameter name. use '@log_level' instead.

since @ is not supported in yaml and every other instance of it has been replaced by $, looking at the fluentd documentation, I've also tried:

# Config 2
- match:
    $tag: '**'
    $type: stdout
    $log_level: debug

however this results in:

[warn]: parameter '$log_level' in <match **>
...
</match> is not used.

Expected behavior

I expect Config 2 not to throw a warning message and instead set the log_level at plugin scope to the according value.

Your Environment

- Fluentd version: 1.16.2
- TD Agent version:
- Operating system: Ubuntu 22.04 LTS
- Kernel version: 5.15

Your Configuration

see To Reproduce

Your Error Log

see To Reproduce

Additional context

No response

@daipom
Copy link
Contributor

daipom commented Apr 12, 2024

@ng-bsy Thanks for your report!
It seems that YAML format fails to take log_level setting into account.

We will check it.

@Shingo-Nakayama
Copy link

We have checked this report and it appears that YAML format doesn't support the $log_level.

We also confirmed that using log_level instead of $log_level results in warn messages, but the log_level setting works fine.

Although this may be improved by future modifications, you can use log_level (without $) for log_level setting for now.

@Shingo-Nakayama
Copy link

Shingo-Nakayama commented Apr 25, 2024

I add description for this issue in the official document.
https://docs.fluentd.org/configuration/config-file-yaml#special-yaml-elements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants