Skip to content

Logger: Log format setting is not applied to the first log #4037

Closed
@daipom

Description

@daipom

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.

2023-02-03 19:24:28 +0900 [info]: fluent/log.rb:330:info: init supervisor logger path=nil rotate_age=nil rotate_size=nil

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

  • Fluentd version: v1.15.3
  • Operating system:
    $ cat /etc/os-release
    NAME="Ubuntu"
    VERSION="20.04.5 LTS (Focal Fossa)"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 20.04.5 LTS"
    VERSION_ID="20.04"
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/"
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    VERSION_CODENAME=focal
    UBUNTU_CODENAME=focal
  • Kernel version:
    $ uname -r
    5.15.0-58-generic

Your Configuration

<system>
  <log>
    format json
    time_format %Y-%m-%dT%H:%M:%S%z
  </log>
</system>

<source>
  @type sample
  tag test
</source>

<match test.**>
  @type stdout
</match>

Your Error Log

2023-02-03 19:24:28 +0900 [info]: fluent/log.rb:330:info: init supervisor logger path=nil rotate_age=nil rotate_size=nil
{"time":"2023-02-03T19:24:28+0900","level":"info","message":"parsing config file is succeeded path=\"../work/fluent.conf\""}
{"time":"2023-02-03T19:24:28+0900","level":"info","message":"gem 'fluentd' version '1.15.3'"}
...

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions