pressly / lg Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] we switched to github.com/rs/zerolog
License: Other
[DEPRECATED] we switched to github.com/rs/zerolog
License: Other
Hi,
Thanks for making this great library available!
We are using it and liking it. However, we don't need both a "request started" and "request complete" JSON log line to be logged, we only need the "request complete" line logged.
Is there an easy way to turn off the "request started" log emission? It's being created in NewLogEntry and maybe we could add a flag to supress this?
# Currently, we get two log lines per request in chi
{ ... "msg": "request started" ... }
{ ... "msg": "request complete" ... }
#We want only one log line per request in chi
{ ... "msg": "request complete" ... }
I could also fork this repo, but I'd prefer not to. Is there a reason for the "request started" log line? Given that the "request complete" log entry catches the interesting data wrt timing, and other fields we might add in our own code, I don't see the need for the "request started" line. It is slowing down our code noticeably and we are paying a third party log hosting company by the GB for hosting our logs, so we want to keep them as small as possible ...
The panic middleware will catch any panics, so I don't see any need for the "request started" line.
Any ideas?
Thanks!
I haven't understood what happened yet, but will try again on a later time. Anyway:
hugo@hp ~/play/lg/_example $ go run main.go
# command-line-arguments
./main.go:55:34: cannot use r (type *chi.Mux) as type context.Context in argument to chi.ServerBaseContext:
*chi.Mux does not implement context.Context (missing Deadline method)
./main.go:55:34: cannot use serverCtx (type context.Context) as type http.Handler in argument to chi.ServerBaseContext:
context.Context does not implement http.Handler (missing ServeHTTP method)
I currently use a library that exposes a logrus.Entry and would love to use lg with it but currently the redirect only accepts a logrus.Logger. They seem to have basically the same interface, so it seems viable.
This package still imports github.com/pressly/chi/middleware
, but that has been renamed to github.com/go-chi/chi/middleware
. Is this package abandoned?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.