https://github.com/loki4j/loki-logback-appender
Fast and lightweight implementation of Logback appender for Grafana Loki
https://github.com/loki4j/loki-logback-appender
grafana-loki java json logback logging loki loki-logback-appender loki4j protobuf
Last synced: 1 day ago
JSON representation
Fast and lightweight implementation of Logback appender for Grafana Loki
- Host: GitHub
- URL: https://github.com/loki4j/loki-logback-appender
- Owner: loki4j
- License: bsd-2-clause
- Created: 2020-10-31T09:32:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-12-20T21:40:04.000Z (26 days ago)
- Last Synced: 2025-12-22T19:50:09.107Z (24 days ago)
- Topics: grafana-loki, java, json, logback, logging, loki, loki-logback-appender, loki4j, protobuf
- Language: Java
- Homepage: https://loki4j.github.io/loki-logback-appender/
- Size: 1.22 MB
- Stars: 375
- Watchers: 4
- Forks: 30
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Notice: NOTICE.txt
Awesome Lists containing this project
- awesome-java - Loki4j
README
# loki-logback-appender


Loki4j aims to be the fastest and the most lightweight implementation of
[Logback](http://logback.qos.ch/) appender for [Grafana Loki](https://grafana.com/oss/loki/).
This project is unofficial and community-driven.
Please proceed to the microsite for more information:
- [Quick Start](https://loki4j.github.io/loki-logback-appender/#quick-start)
- [Configuration Reference](https://loki4j.github.io/loki-logback-appender/docs/configuration)
- [Migration Guide](https://loki4j.github.io/loki-logback-appender/docs/migration)
If you have found this project helpful, please drop a :star:!
## Key features
- Dynamic generation of Loki labels and metadata out of any Logback pattern, MDC, KVP, or SLF4J markers
- Structured metadata support
- Fast JSON layout for log message formatting
- Support of JSON and Protobuf Loki API flavors
- Compatibility with Grafana Cloud
- Zero-dependency
- Performance metrics
More details and links to the examples can be found [here](https://loki4j.github.io/loki-logback-appender/#key-features).
## Contributing
Please start with the [Contribution guidelines](CONTRIBUTING.md).
## Building and testing the project
Please make sure the following software is installed on your machine
so you can build and test the project:
- Java 11 or later
Check out the project in the directory on your local machine and run:
```sh
./gradlew check
```
## Project status
At the moment all the main logging features have been implemented and stabilized.
Further development will be concentrated on bug fixes (if any), keeping up with new versions of Loki, and
improving the codebase so it's easier to maintain.