gin-contrib / logger

Gin middleware/handler to logger url path using rs/zerolog
MIT License
192 stars 35 forks source link

feat: add option to pass context to logger #92

Closed mgabeler-lee-6rs closed 2 weeks ago

mgabeler-lee-6rs commented 6 months ago

Adds WithContext() option that will cause the gin context to be passed to the zerolog event via logger.Ctx(...)

This is useful for zerolog hooks to be able to attach additional metadata, such as tracing span IDs and other contextual metadata to the event.

appleboy commented 2 weeks ago

fixed in https://github.com/gin-contrib/logger/commit/9c6ff6577a0d6f5ad74c265ba52ca3aab881a5c5