-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Logger: Log format setting is not applied to the first log #4037
Comments
I will fix this. |
I'm trying to fix this, but I have some questions about the initialization of the logger. Why does the supervisor process initialize the logger in fluentd/lib/fluent/supervisor.rb Lines 443 to 453 in e89092c
Fluentd passes the function as a callback to ServerEngine. fluentd/lib/fluent/supervisor.rb Lines 898 to 900 in e89092c
I have checked the related codes of ServerEngine, but I can't see the reason for initializing the logger in the callback. I thought it might have something to do with the function of reloading the config, such as SIGUSR2, but that doesn't seem to be true. I'm going to look into this a little more, but it appears that the logger settings are determined at point fluentd/lib/fluent/supervisor.rb Lines 810 to 826 in e89092c
I think we should limit the initialization point to (I understand the logger must be initialized temporarily in order to output some logs before parsing the config. |
Describe the bug
I noticed this issue when I was checking #4011.
The log of initializing logger is added in Fluentd v1.15.3 at #3939:
Fluentd outputs this log first.
However, the log format is not applied to this log.
At the point of
LoggerInitializer::init()
, the format is not applied yet, so the logger must not output logs.To Reproduce
Run Fluentd v1.15.3 by the following config and see the first log.
$ bundle exec fluentd -c /path/to/fluent.conf
Expected behavior
Log format setting is applied to the all logs of Fluentd.
Your Environment
Your Configuration
Your Error Log
Additional context
No response
The text was updated successfully, but these errors were encountered: