-
Notifications
You must be signed in to change notification settings - Fork 113
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
Suppress tusd logs #3552
Suppress tusd logs #3552
Conversation
Signed-off-by: jkoberg <[email protected]>
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Signed-off-by: jkoberg <[email protected]>
0a80ccc
to
7b52458
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
well, yeah, this disables the log ... but there is no way to reenable it. I guess we need to invest in upstream patches that fetch the logger from the context. or maybe fetching the logger from the context is not a good pattern? Then again, I don't see a good way of changing the log level for different users ... maybe using logging for user specific logs is the wrong approach. Maybe that is better done with tracing and span attributes. That should in theory allow us to pass a logger to the handlers, like the tus handler, wrap it with a trace middleware and have the best of both worlds? Not part of this PR, though ... |
Why is there no way to reenable it? We pass a custom logger. I expect it to log through the logger we provided. Otherwise this is a upstream bug (either in basic log or zerolog package). |
@@ -99,6 +100,7 @@ func (m *manager) Handler(fs storage.FS) (http.Handler, error) { | |||
config := tusd.Config{ | |||
StoreComposer: composer, | |||
NotifyCompleteUploads: true, | |||
Logger: log.New(appctx.GetLogger(context.Background()), "", 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, now that the discussion is on, let me throw in my 2 cents. Can we pass in the active context instead of creating it on the fly because the active context holds the requestID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no active context. This happens on service init
fixes owncloud/ocis#4803 by passing a Logger to the tusd package