https://github.com/jkaninda/logger
Logger is a configurable logging solution with multiple output options, log levels, and rotation capabilities built on top of Go's slog package.
https://github.com/jkaninda/logger
go-logger go-logging slog slogger
Last synced: about 1 month ago
JSON representation
Logger is a configurable logging solution with multiple output options, log levels, and rotation capabilities built on top of Go's slog package.
- Host: GitHub
- URL: https://github.com/jkaninda/logger
- Owner: jkaninda
- License: mit
- Created: 2025-05-31T03:20:17.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-13T20:17:30.000Z (4 months ago)
- Last Synced: 2025-07-26T12:48:39.245Z (3 months ago)
- Topics: go-logger, go-logging, slog, slogger
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LOGGER
[](https://github.com/jkaninda/logger/actions/workflows/tests.yml)
[](https://goreportcard.com/report/github.com/jkaninda/logger)
[](https://go.dev/)
[](https://pkg.go.dev/github.com/jkaninda/logger)
[](https://github.com/jkaninda/logger/releases)**Logger** provides a configurable logging solution with multiple output options, log levels, and rotation capabilities built on top of Go's slog package.
## Installation
```bash
go get github.com/jkaninda/logger
```
## Usage Example```go
l := logger.New(
WithOutputFile("/var/log/app.log"),
WithCaller(),
WithInfoLevel(),
WithMaxAge(1),
WithMaxSize(100),
WithJSONFormat(),
)
l.Info("Application started", "version", "1.0.0")
```
## Default config```go
l := logger.Default()
l.Info("Application started", "version", "1.0.0", "config", "default")
```## Using global logger instance
```go
logger.New(logger.WithJSONFormat())logger.Info("Application started", "version", "1.0.0")
```
---## Contributing
Contributions are welcome!
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to your fork
5. Open a Pull Request---
## Give a Star! ⭐⭐ If you find Okapi useful, please consider giving it a star on [GitHub](https://github.com/jkaninda/logger)!
## License
This project is licensed under the MIT License. See the LICENSE file for details.
## Copyright
Copyright (c) 2025 Jonas Kaninda