Comments (7)
Yup, that's exactly what I had in mind when I mentioned standard library. Should have been more explicit.
I can't think of any other library that even asks for a logger (I looked through the ~4 that I had on the top of my mind to check). Everything I'm familiar with elevates errors and lets the consumer log or not.
from brokerapi.
I also would like to echo @cholick's thoughts on being forced into a logger decision. I also wanted to use logrus because it's much more feature-rich than lager. lager is pretty anemic and it's session/contextual management isn't great. My use case isn't about structured logging as much as I need much better context and session management that is human-friendly for both development and deployment.
These are popular logging options which all implement log.Logger
:
- github.com/sirupsen/logrus
- github.com/golang/glog
- go.uber.org/zap
- github.com/davecgh/go-spew
- github.com/ssgreg/journald
I think the ideal implementation should only require log.Logger
from the stdlib and then whichever logging library consumers leverage is up to them. It's not great being forced into a library decision.
from brokerapi.
We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.
The labels on this github issue will be updated when the story is started.
from brokerapi.
Thanks for raising this @cholick.
We chose lager as it provides structured logging, which we have heard operators find useful. I understand having logs in a mixed format isn't ideal.
I have added some details to the story to explore how we could accept a generic logger, allowing the user to provide a logger of their choosing.
from brokerapi.
As lager.Logger is an interface and, although log.Logger doesn't implement it, it is possible for consumers of brokerapi to wrap log.Logger or another logger to implement lager.Logger interface. This would allow you to control the structure of the log. Would this help?
Also, do you have any examples of other libraries that handle the "bring your own logger" scenario?
from brokerapi.
This isn't a huge deal either; if you feel that it's more hassle than it's worth, feel free to close. Motivation for filing issue was that I was paring an implementing a broker, we just got a bit frustrated that we couldn't use a more feature rich structured library like logrus that would let us trivially switch output non-structured, pretty-print logs as we were doing development.
from brokerapi.
I am going to close this for now. I feel that this problem is likely inherent to the fact that the package acts as a framework rather than a library.
If anyone has ideas / other Go frameworks that do this well, I am open to re-opening this issue.
from brokerapi.
Related Issues (20)
- Binding struct is missing support for Endpoint? HOT 4
- Audit log by the APIHandler type HOT 3
- Missing metadata field in ProvisionedServiceSpec HOT 4
- Missing allow_context_updates field HOT 7
- Unversioned handlers shouldn't not use versioned domain/apiresponses HOT 2
- Use of authentication methods other than Basic Auth HOT 6
- v8 backwards compatiblity HOT 7
- Is the FailureResponse status code used? HOT 4
- test issgu HOT 1
- Incorrect type for metadata fields in Get/Provision/Deprovision responses HOT 3
- Broker does not accept url-encoded forward slash in instance_id HOT 6
- Ability to implement custom ServicePlanCost? HOT 1
- Feature request: Simple way to add prometheus exporter HOT 3
- Support for Binding rotation HOT 3
- Requirement to expose additional API endpoints HOT 3
- Setting CF labels not supported? HOT 4
- Use chi.Router interface for AttachRoutes method HOT 3
- for v11: NewFailureResponse() should return error not *apiresponses.FailureResponse HOT 3
- Replace lager.Logger with log/slog.Logger HOT 4
- Possibility to register a custom middle ware HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brokerapi.