-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use relative path instead of absolute path in symlink_path
for the out file plugin
#4904
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Florian Dobener <[email protected]>
It might be better to keep the default behavior. |
Thanks for this PR!
Could you please explain in more detail? |
Sure. In my project I'm using fluentd to collect the logs in a docker compose stack. For some containers I want to write file based logs to disk, i.e., I mount them from the external fs into the container. I use the
You mean keeping the behaviour of |
Thanks! Please let me confirm a few more things.
So Fluentd collects logs in a container, but those logs are actually in an external file system, and it is mounted to the container.
Does this mean that the external application outside the container collects logs from the symlink inside the container?
This is still not clear to me. |
Can't you use Docker Logging Driver in your use case? |
On the system fluentd collects logs from all running containers through the docker logging driver. I directly forward all logs to a loki storage but for two services I additionally create files with the
The external application monitors for failed logging attemps. So I actually need a single file which contains just the latest events. However, the external application is not able to reload the log files, i.e., I cannot use the buffer file directly since the hash is changing. Hence, I use the symlink to the buffer to readout the latest events.
It basically looks like this on the outside:
If I keep using the absoulte path from fluentd this the link looks like this
and this internal folder The only thing I want is the |
Thanks! I see! Here's what I understand. You mount a host directory to a container, and Fluentd inside that container writes files into that directory.
Thanks so much! I have one question.
( Even if we use a relative path, I think we will eventually need to resolve the relative path on the host side. |
Sorry, I misunderstood a relative symlink behavior. |
Thanks! Finally I understand!
Maybe it would not break compatibility if it were a relative path? |
Which issue(s) this PR fixes:
There is no particular issue associated. If necessary I can create one.
What this PR does / why we need it:
This PR moves from an absolute link to a relative link for
symlink_path
parameter. Otherwise, this does not work in a dockerized environment where the path is wired to the the outside of the container.I can also add an additional parameter to switch between absolute and relative linking if necessary and/or desired.
Docs Changes:
I think doc changes are not necassary. However, as far as I read it the documentation does not state whether its an absolute or relative link and it might be useful to add in the scope of this PR.
Release Note:
Uses relative link for
symlink_path
in the out file plugin.