https://github.com/zolyfarkas/spf4j-logback
logback avro appenders and encoders for structure and efficiency
https://github.com/zolyfarkas/spf4j-logback
avro java logback logs
Last synced: about 2 months ago
JSON representation
logback avro appenders and encoders for structure and efficiency
- Host: GitHub
- URL: https://github.com/zolyfarkas/spf4j-logback
- Owner: zolyfarkas
- Created: 2019-02-09T16:52:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-22T17:53:54.000Z (about 2 years ago)
- Last Synced: 2025-07-17T10:42:45.663Z (8 months ago)
- Topics: avro, java, logback, logs
- Language: Java
- Homepage:
- Size: 189 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spf4j-logback
A collection of logback components to implement:
* Log directly to avro data files. Significantly more compacter (5x), structured. See schema [at](https://zolyfarkas.github.io/core-schema/avrodoc.html#/schema/org%2Fspf4j%2Fbase%2Favro%2FLogRecord.avsc/org.spf4j.base.avro.LogRecord)
* Json encoder to use with stock logback appenders.
* Available /logs JAX-RS [actuator endpoint](https://github.com/zolyfarkas/jaxrs-spf4j-demo/wiki/JaxRsActuator), that allows you fast access to your logs, across your entire cluster. (in spf4j-jaxrs-actuator)
latest version: [](https://maven-badges.herokuapp.com/maven-central/org.spf4j/spf4j-logback/)
To use it all you need to do it to add :
```
org.spf4j
spf4j-logback
LATEST
```
and configure your logback.xml accordingly.
The library contains a default [logback.xml](https://github.com/zolyfarkas/spf4j-logback/blob/master/src/main/resources/logback.xml)
that will log to the console in text format. The console output is usually used during the initialization and destruction phase
of the process, before and after [LogbackService](https://github.com/zolyfarkas/spf4j-logback/blob/master/src/main/java/org/spf4j/log/LogbackService.java).
LogbackService defaults to [logback-avro.xml](https://github.com/zolyfarkas/spf4j-logback/blob/master/src/main/resources/logback-avro.xml) which will
log all logs to a avro binary file.
Here is a example logback configuration to enable all logs to a avro log file, and errors to the console in json format as well.
```
ERROR
${logFileBase}
/var/log
500
1000
```