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

Structured logging as used in log15/logrus #97

Closed
tonyhb opened this issue Aug 14, 2015 · 5 comments
Closed

Structured logging as used in log15/logrus #97

tonyhb opened this issue Aug 14, 2015 · 5 comments
Assignees

Comments

@tonyhb
Copy link

tonyhb commented Aug 14, 2015

Log15 has a very nice API for structured logging which is compatible with varargs style logging (see here: https://github.com/inconshreveable/log15#faq).

Could this be implemented?

@ChrisHines
Copy link
Member

@tonyhb I am a heavy user and one of the maintainers of log15, so I am familiar with the feature you linked to. Honestly, I've never felt the need to use that feature. I would like to hear more about your experience to get some perspective on the benefits of this feature.

@tonyhb
Copy link
Author

tonyhb commented Aug 31, 2015

@ChrisHines for me it's only the structure and ease of readability of using map-like arguments instead of varargs — though that's about the only reason. It's why I'm a huge fan of Logrus' log.Fields{...}. Completely understand that personal preference isn't a valid reason for implementation, though.

@ChrisHines
Copy link
Member

@tonyhb I am interested to see an example of how you use Logrus' log.Fields{...} or log15.Ctx.

One of the early proposals for the Go kit log API had a Logrus style API. I argued against that style here: #21 (comment).

@peterbourgon
Copy link
Member

I do see the value in having typed arguments to Log, especially (perhaps only) for applications using log-structured data, rather than simple application logs. But I'd expect all of those use cases would have application-specific types, and they'd all boil down to wrappers around the existing API anyway, so I'm not sure how much value an explicit Fields type would provide.

@ChrisHines
Copy link
Member

Closing this as out of scope for the core log package.

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

3 participants