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

How to deal with the increasing access log? #1109

Closed
spgyip opened this issue Jun 14, 2017 · 8 comments
Closed

How to deal with the increasing access log? #1109

spgyip opened this issue Jun 14, 2017 · 8 comments
Labels
question Questions that are neither investigations, bugs, nor enhancements

Comments

@spgyip
Copy link

spgyip commented Jun 14, 2017

We deploy a 'service pod' along with a sidecar envoy. The problem is the access log of envoy, there is no size-limit or log-rotate supported by envoy. So we have to clean out the access log when it grow too large, e.g. launch another shell/program to rename access log and reload the envoy(Just like what we do with nginx access log).

However, dealing with hundreds or thousands of 'service pod' is also a tough job I think, not graceful.
What do you suggest to do with?

Or if I don't make my scenario understandable, please reach me out.

@dnoe
Copy link
Contributor

dnoe commented Jun 14, 2017

I am doing some ongoing work to ship Access Logs in proto format to a gRPC log sink which should be properly formed up into to a PR later this week. One canonical example of this is the Google Stackdriver public API, but you could develop your own gRPC service and send the logs to it. This will give you the ability to collect all access logs centrally and decide what you want to keep and for how long. I don't know whether this would meet your needs or is too much complexity but I wanted to let you know it's something that's in the works. You can see the proto format in https://github.com/lyft/envoy-api/blob/master/api/accesslog.proto

For a simple solution I'd suggest using something like the standard logrotate typically shipped by Linux distributions rather than trying to build this into Envoy itself.

@mattklein123 mattklein123 added the question Questions that are neither investigations, bugs, nor enhancements label Jun 14, 2017
@mattklein123
Copy link
Member

per @dnoe we will likely not implement any sysadmin type functionality like this directly in envoy when well known solutions already exist (in this case logrotate).

@spgyip
Copy link
Author

spgyip commented Jun 15, 2017

@dnoe Thanks for that. Actually, logging to remote is a workable solution, but I think it's too heavy to handle the access log situation.

I am looking forward to solution like logrotate, not invaded to envoy itself.

@mattklein123
Copy link
Member

Closing for now as we are unlikely to build this type of ops functionality into envoy directly.

@perlun
Copy link
Contributor

perlun commented Oct 9, 2018

For people reading this who might be unfamiliar with logrotate, it's configuration files are kept in /etc/logrotate.d on a typical Debian/Ubuntu machine. man logrotate will give you some more information about how it works, including an example rotate config you can use as template for building your own, personalized configuration.

@yury-alpatov
Copy link

Can you please explain me, how to enable this functionality in already installed Istio (in OpenShift)? I tried to edit ConfigMap “istio” but it doesn’t take effect (enableEnvoyAccessLogService: true, envoyAccessLogService address).

@pat70
Copy link

pat70 commented Sep 22, 2020

per @dnoe we will likely not implement any sysadmin type functionality like this directly in envoy when well known solutions already exist (in this case logrotate).

foreversd/forever#106 (comment)
"
So, in case of create logrotate option - forever proceeds to write to rotated log file instead of main one.
If copytruncate option set - forever write to main log file, but it's not wiped when rotated and logs keep accumulate.

Does someone have a solution?
"

@mladenkralev
Copy link

mladenkralev commented Nov 18, 2021

We have a similar issue where we use logrotate to rotate logs in a pod. Seems strange that despite enforcing log rotation the newly created file is ignored and only the old (already rotated file) is used and growing.

Does anyone else also hit this issue?
We are using 1.17.4 envoy version and the logrotate configuration file looks similar to:
/tmp/* { rotate 3 size 1k compress delaycompress }

Edit
Adding copytruncate option from logrotate solved the problem for our team

jpsim pushed a commit that referenced this issue Nov 28, 2022
Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: JP Simard <[email protected]>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: JP Simard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions that are neither investigations, bugs, nor enhancements
Projects
None yet
Development

No branches or pull requests

7 participants