Closed ryepup closed 1 year ago
hey, I'm open to the feature itself, but not sure I'm sold on the implementation proposal.
I will think about how to implement it.
Hey,
I added RequestIDHeader
option to the Middleware configuration.
e.Use(lecho.Middleware(lecho.Config{
Logger: logger,
RequestIDHeader: "traceID",
}))
Will it be sufficient for you? Or do you need both?
Here is a way to enrich the logger with additional values: https://github.com/ziflex/lecho/pull/19
Let me know if it works for you.
That looks great, very extensible.
I'm using opentelemetry (otel) to trace my echo requests, and I would like the otel
traceID
to be a field in the logs made bylecho
. Currentlylecho
has special handling forX-Request-ID
, it would be great if that were extensible.My current workaround is a partial fork of
lecho
using echo'smiddleware.RequestLoggerWithConfig
, and it'd be nice to drop that.One possible API would look something like:
or maybe lump it into the
logger
itself:Would you be open to this kind of addition?