https://github.com/moul/zapconfig
⚡ Opinionated presets for Uber's Zap logging go library
https://github.com/moul/zapconfig
golang logger zap zaplog
Last synced: 2 months ago
JSON representation
⚡ Opinionated presets for Uber's Zap logging go library
- Host: GitHub
- URL: https://github.com/moul/zapconfig
- Owner: moul
- License: other
- Created: 2020-10-01T16:21:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-24T15:47:02.000Z (3 months ago)
- Last Synced: 2025-04-14T19:06:33.571Z (2 months ago)
- Topics: golang, logger, zap, zaplog
- Language: Go
- Homepage: https://manfred.life/go
- Size: 93.8 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Support: .github/SUPPORT.md
- Authors: AUTHORS
Awesome Lists containing this project
README
# zapconfig
:smile: zap logger configurations
[](https://pkg.go.dev/moul.io/zapconfig)
[](https://github.com/moul/zapconfig/blob/master/COPYRIGHT)
[](https://github.com/moul/zapconfig/releases)
[](https://microbadger.com/images/moul/zapconfig)
[](https://manfred.life/)[](https://github.com/moul/zapconfig/actions?query=workflow%3AGo)
[](https://github.com/moul/zapconfig/actions?query=workflow%3ARelease)
[](https://github.com/moul/zapconfig/actions?query=workflow%3APR)
[](https://golangci.com/r/github.com/moul/zapconfig)
[](https://codecov.io/gh/moul/zapconfig)
[](https://goreportcard.com/report/moul.io/zapconfig)
[](https://www.codefactor.io/repository/github/moul/zapconfig)## Usage
[embedmd]:# (example_test.go /import\ / $)
```go
import (
"go.uber.org/zap/zapcore""moul.io/zapconfig"
)func Example() {
logger := zapconfig.Configurator{}.MustBuild()
logger.Info("hello!")
}func Example_configuration() {
logger := zapconfig.New().
EnableStacktrace().
SetLevel(zapcore.DebugLevel).
SetOutputPath("stderr").
SetOutputPaths([]string{"stderr", "stdout", "./path/to/log.txt"}).
SetPreset("light-console").
MustBuild()
logger.Info("hello!")
}
```## Install
### Using go
```console
$ go get moul.io/zapconfig
```### Releases
See https://github.com/moul/zapconfig/releases
## Contribute

I really welcome contributions. Your input is the most precious material. I'm well aware of that and I thank you in advance. Everyone is encouraged to look at what they can do on their own scale; no effort is too small.
Everything on contribution is sum up here: [CONTRIBUTING.md](./CONTRIBUTING.md)
### Contributors ✨
[](#contributors)
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Manfred Touron
🚧 📖 ⚠️ 💻
moul-bot
🚧
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
### Stargazers over time
[](https://starchart.cc/moul/zapconfig)
## License
© 2020 [Manfred Touron](https://manfred.life)
Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([`LICENSE-APACHE`](LICENSE-APACHE)) or the [MIT license](https://opensource.org/licenses/MIT) ([`LICENSE-MIT`](LICENSE-MIT)), at your option. See the [`COPYRIGHT`](COPYRIGHT) file for more details.
`SPDX-License-Identifier: (Apache-2.0 OR MIT)`