MadAppGang / httplog

Golang HTTP logger middleware with color console output and structured logs
MIT License
130 stars 3 forks source link

Curious if you'd integrate this with Caddy! #19

Open francislavoie opened 1 year ago

francislavoie commented 1 year ago

I really like the look of this!

I was curious to see if you'd be interested in playing with this with Caddy; it seems like it would integrate nicely, since Caddy uses Zap for logging everything.

See https://caddyserver.com/docs/logging which TL;DR explains why Common Log sucks and why structured logging is what we chose for Caddy.

Caddy uses a plugin system and you can provide a logging encoder module (formatter) by implementing a module in the caddy.logging.encoders.* namespace. The ones that exist are listed here: https://caddyserver.com/docs/json/logging/logs/encoder/, and docs on extending Caddy here https://caddyserver.com/docs/extending-caddy

erudenko commented 1 year ago

Hi @francislavoie

I am a big lover of Caddy, I will look at possible Caddy integration.

erudenko commented 1 year ago

Hi @francislavoie

Do you have any ideas why it could be useful?

francislavoie commented 1 year ago

It would be cool to have an alternative pretty formatter specifically for access logs. That's something lacking in Caddy.

erudenko commented 1 year ago

@francislavoie yep, good idea. Thank you.