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

Support disabling logs, at least for requests forwarded upstream? #49

Open
nogweii opened this issue Nov 13, 2024 · 1 comment · May be fixed by #50
Open

Support disabling logs, at least for requests forwarded upstream? #49

nogweii opened this issue Nov 13, 2024 · 1 comment · May be fixed by #50

Comments

@nogweii
Copy link

nogweii commented Nov 13, 2024

Wondering if you would consider a PR that added a new environment variable to disable logs for HTTP requests sent upstream? Or all logs, if you wanted it more coarse.

I'm running thruster & puma with a Rails application in kubernetes, with probes turned on. That's pinging my healthcheck endpoint a lot. I can disable the logs within Rails, but I don't see a way to stop the logs from thruster itself.

I already have logs from the Rails code that has the information I care about, so the log message from thruster are repetitious for me.

@kevinmcconnell
Copy link
Collaborator

@nogweii yes, that's a great idea, thanks for bringing it up. I agree that the request logs can be superfluous in some cases.

I'd lean towards keeping any other logs, in case we need to emit something important, but being able to silence the request logs seems useful. So maybe we can support something like LOG_REQUESTS=false which prevents the logging middleware from being loaded. Default would be to log the requests, as we do now.

Happy to look at a PR for this!

nogweii added a commit to nogweii/thruster that referenced this issue Nov 14, 2024
Adds an environment variable, $LOG_REQUESTS, that when set to a falsey
value will not add the logging middleware to the HTTP handler, disabling
request logs. Other logs, like the startup messages, are left alone.

Closes basecamp#49.
@nogweii nogweii linked a pull request Nov 14, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants