https://github.com/brocode/brolog
A simple slf4j backend with JSON output
https://github.com/brocode/brolog
Last synced: about 1 month ago
JSON representation
A simple slf4j backend with JSON output
- Host: GitHub
- URL: https://github.com/brocode/brolog
- Owner: brocode
- License: mit
- Created: 2021-12-15T13:03:59.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-01T09:17:10.000Z (over 2 years ago)
- Last Synced: 2023-11-01T10:28:04.817Z (over 2 years ago)
- Language: Kotlin
- Homepage:
- Size: 183 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# brolog
Provide a simple slf4j backend.
Defaults to JSON output to stdout.
brolog is intended for containers. Logging to
files or other fancy stuff is not supported.
## Motivation
I wanted something simple that works well in containerized environments.
- No file appenders
- No config file
- JSON output
- Includes MDC and additional key value pairs in the JSON log entry.
## Tests
There is a simple human-readable logger that is only intended for unit tests.
Using json output when running tests in the IDE is just not ideal.
Just set the system property `brolog.simple.mode` or the environment variable `BROLOG_SIMPLE_MODE` to true.
### Gradle example
```kotlin
test {
systemProperty("brolog.simple.mode", "true")
}
```
### Shell example
```shell
BROLOG_SIMPLE_MODE=true ./gradlew test
```
## Gradle
```kotlin
implementation("sh.brocode:brolog:$version")
```
## Configuration
Use the environment variable`BROLOG_ROOT_LEVEL` to
configure the root log level.
For logger levels define environment variables with
the prefix `BROLOG_LEVEL_`.
## Read JSON log files on the CLI
Try [fblog](https://github.com/brocode/fblog/)
## Release
``` shell
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
```