-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Deadlock when using WithField inside of hook #1120
Comments
@andytsnowden thanks for reporting! Yes would you please provide a full code example to reproduce the bug? |
Sure, here's a small script package main
import (
"github.com/onrik/logrus/filename"
"github.com/sirupsen/logrus"
)
func main() {
filenamehook := filename.NewHook()
filenamehook.Field = "fileline"
logrus.AddHook(filenamehook)
logrus.SetLevel(logrus.DebugLevel)
logrus.Debug("hello there")
} This could very well just be a problem with onrik/logrus/filename figured I would open it here first since I saw the related issue that wasn't using the same hook I was. In terms of go versions I've tried 1.14.1, 1.13.9 and 1.12.17 none of which seem to behave differently. |
Maybe the problem is the same with #1122 (comment) |
Should be fixed by #1131 |
@andytsnowden can you confirm the issue is fixed with the latest version v1.6.0 ? |
@dgsb Confirmed fixed in 1.6.0 TY |
This is most likely related to #807
When using a Hook to add file/line data to each log message we get a deadlock.
Relevant code block in question:
If I change my program options to skip this step, such as going to "info" log level it executes without a problem. Tested on both 1.12.6 macOS/Windows and 1.14 alpine.
Happy to provide a simplified code example if needed.
The text was updated successfully, but these errors were encountered: