go-kit / go-kit/kit

panic() is not working with logger

Open
#609 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
27.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

When happens the `panic()` during the application execution, it should let the `panic` happen, but instead of it the logger is avoiding the `panic` and just showing:

```json
{"caller":"http: panic serving [::1","host":"localhost","msg":"]:65031: interface conversion: interface {} is string, not int","pid":9294,"ts":"2017/09/14 13:19:58","version":"20170914.201954"}
```

When the go-kit logger is not being used:

```2017/09/14 13:17:38 http: panic serving [::1]:64967: interface conversion: interface {} is string, not int
goroutine 20 [running]:
net/http.(*conn).serve.func1(0xc42008de00)
/usr/local/go/src/net/http/server.go:1721 +0xd0
panic(0x14fcb60, 0xc420191400)
/usr/local/go/src/runtime/panic.go:489 +0x2cf

...

net/http.HandlerFunc.ServeHTTP(0xc42017e520, 0x1811100, 0xc4200e4700, 0xc42000b600)
/usr/local/go/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc420130b00, 0x1811100, 0xc4200e4700, 0xc42000b600)
/usr/local/go/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc42008de00, 0x1811940, 0xc420191200)
/usr/local/go/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2668 +0x2ce
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.