You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fluentd formatter process_info method is outdated and not working.
It inherits from Json, which inherits from Raw, which inherits from Base – none of them has the process_info method anymore. It only exists in Default (for backward compatibility I suppose).
Since you use Fluentd, can you help explain what it is trying to do in this appender. The comment indicates Ignore fields: pid, thread, file and line by default. I.e. do we want to exclude these fields from the output JSON for Fluentd by default/always?
Hi, I think yes – Fluentd is mostly used in a containerized environment where processes usually have pid = 1 and hostname is the docker container id, which makes little sense to put in logs. Not sure what was the reasoning behind ignoring the file and line, I'm not using this anyway.
I was confused by this too. It definitely doesn't do what it says on the tin and, after looking into fixing it, I suspect it hasn't worked for a while.
As @leshik mentioned, when using Docker, setting the container ID as the hostname isn't very useful and was one of the reasons I was looking at using this formatter. But it never excluded the host in the first place.
With options like log_host already available on the base class my vote would be to deprecate and remove this formattter to avoid confusion. Thanks to the way the formatter code is structured it's easy to write a very simple formatter of your own if you need functionality like this. That's what I plan to do.
Activity
reidmorrison commentedon Jan 17, 2022
Since you use Fluentd, can you help explain what it is trying to do in this appender. The comment indicates
Ignore fields: pid, thread, file and line by default
. I.e. do we want to exclude these fields from the output JSON for Fluentd by default/always?leshik commentedon Jan 18, 2022
Hi, I think yes – Fluentd is mostly used in a containerized environment where processes usually have
pid
= 1 andhostname
is the docker container id, which makes little sense to put in logs. Not sure what was the reasoning behind ignoring the file and line, I'm not using this anyway.henare commentedon Jan 16, 2025
I was confused by this too. It definitely doesn't do what it says on the tin and, after looking into fixing it, I suspect it hasn't worked for a while.
As @leshik mentioned, when using Docker, setting the container ID as the hostname isn't very useful and was one of the reasons I was looking at using this formatter. But it never excluded the host in the first place.
With options like
log_host
already available on the base class my vote would be to deprecate and remove this formattter to avoid confusion. Thanks to the way the formatter code is structured it's easy to write a very simple formatter of your own if you need functionality like this. That's what I plan to do.