https://github.com/networkteam/apexlogutils
Go package for utilities around github.com/apex/log
https://github.com/networkteam/apexlogutils
Last synced: about 2 months ago
JSON representation
Go package for utilities around github.com/apex/log
- Host: GitHub
- URL: https://github.com/networkteam/apexlogutils
- Owner: networkteam
- License: mit
- Created: 2020-11-18T12:58:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-18T15:50:56.000Z (over 1 year ago)
- Last Synced: 2024-09-28T09:13:17.505Z (over 1 year ago)
- Language: Go
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apexlogutils
Go packages with utilities around github.com/apex/log.
## What does it do?
This code was extracted from multiple production applications for integration with *HTTP request logging*, *DB driver logging with pgx* and a custom text log handler that
outputs a component field to quickly identify the source of a log message in development.
The HTTP logger is based on https://github.com/apex/httplog but is a more complete `http.ResponseWriter` wrapper (see https://github.com/gorilla/handlers) and includes an
option to not log requests for paths with a given prefix (e.g. health checks). It also uses a log instance from `context.Context` if set, so it's a nice combination with
`middleware.RequestID` to have a unique id for each request to correlate log messages.