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

Log Caller does not work with json logging #130

Closed
kris-runzer opened this issue Sep 21, 2015 · 2 comments
Closed

Log Caller does not work with json logging #130

kris-runzer opened this issue Sep 21, 2015 · 2 comments
Assignees

Comments

@kris-runzer
Copy link

I've noticed that using NewJSONLogger that caller is always an emtpy {} when logging:

logger = log.NewJSONLogger(os.Stderr)
logger = log.NewContext(logger).With("caller", log.DefaultCaller)
​logger.Log()

Results in the following log output:

{"caller":{}}

@ChrisHines ChrisHines self-assigned this Sep 21, 2015
@ChrisHines
Copy link
Member

Thanks for the issue report.

@ChrisHines
Copy link
Member

I have added a test case for this issue: c158bb5.

The fix is implemented in the upstream package gopkg.in/stack.v1: go-stack/stack@03cd31e.

To get the fix, run:

go get -u gopkg.in/stack.v1
go get -u github.com/go-kit/kit

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

No branches or pull requests

2 participants