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

write logs to stdout #17

Open
geekflyer opened this issue Aug 14, 2019 · 4 comments
Open

write logs to stdout #17

geekflyer opened this issue Aug 14, 2019 · 4 comments

Comments

@geekflyer
Copy link

geekflyer commented Aug 14, 2019

Hi,

currently it appears the agent writes the logs into a file inside the container which makes them hard to access and inspect and eventually hard to debug when something is going wrong (i.e. connection issues). Imho writing to a file makes little sense in combination with -foreground. It is very typical for containers (i.e. in kubernetes) to simply log to stdout / stderr.

Via a bit of try and error I found the agent inside the container actually has a parameter -log-type and when setting this to -log-type=stderr it actually writes logs to stderr which is more or less what I need (although I would prefer if it writes to stdout).

So two requests:

  1. Please change the default dockerfile to already include -log-type=stderr or something equivalent.

  2. Is the -log-type parameter documented somewhere? What are the possible values it has (i.e. is there something like stdout instead)?

Thanks

@hanselakers
Copy link

hanselakers commented Aug 14, 2019

Hey @geekflyer,

Thanks for providing us with your feedback! Really helpful. This isn't something that has come up too often but always welcome great feedback for our product team. I believe (one of the reasons) we currently write logs into a file is because you (as the VividCortex user) can fetch the agent logs from inside the app on the 'Agents' page.

I believe the -log-type params are syslog | file | stderr, with file (as you mentioned) as the default -log-type param.

If you keep the param as file, you should be able to access all agent logs from the VividCortex app.

Let me know if that is helpful. I will discuss this a bit more internally as well. Look forward to connecting again soon!
Thanks,
-Hansel

@geekflyer
Copy link
Author

geekflyer commented Aug 14, 2019

I see. Yeah well, I think keeping it as "file" and "fetching" the logs from the vividcortex app (by clicking the "get agent log" button) is imho not great of an experience compared to simply streaming the logs to stdout / stderr and then watching them via kubectl logs or via a central log aggregator / analytics solution. I'd argue that most folks which use kubernetes in production are already using some central log aggregator as kubernetes is otherwise hard to use in production at scale. We for example use Stackdriver Logging (which comes out of the box with GKE) and Scalyr and for me it is much more useful to see the logs in there.
Furthermore the ability to "fetch" logs from the vividcortex app has the implicit assumption that the agent can connect correctly in the first place. If the agent cannot connect due to networking issues or invalid configuration one is basically kind of "lost" when using the "file" log type.

TLDR: For 95% of the users -log-type=stderr is the best default choice when running the agent in a container.

@hanselakers
Copy link

Thanks for the additional feedback! Sharing this with our product team!

@hanselakers
Copy link

@geekflyer -
The VividCortex engineering team has already replied and agreed that additional logging options (i.e.stderr) are good enhancements. I do not currently have a timeline for any changes, but I wanted to let you know your request has been received.

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

No branches or pull requests

2 participants