-
tinylog2-humio
is a Writer implementation for tinylog2 writing log messages to a HUMIO using Ingest API -
library supports
gzip
compression and batch write triggerd by either interval or minimum events -
tiny library with minimal dependencies
-
using stream-batch-interval - for batching
-
using humio-java-client - as java client
The following configuration settings are supported by tinylog2-humio
:
serverEndpoint
(default:https://cloud.humio.com
)- humio server endpoint
- this value can also be override by
-DHUMIO_SERVER_ENDPOINT
orHUMIO_SERVER_ENDPOINT
as ENVIRONMENT variable
serverToken
(default:EMPTY
)- ingest token
- this value can also be override by
-DHUMIO_SERVER_TOKEN
orHUMIO_SERVER_TOKEN
as ENVIRONMENT variable
- this value can also be override by
- ingest token
serverUri
(default:/api/v1/ingest/humio-structured
)- full path for ingestion api
hostname
(default: local hostname orlocalhost
as fallback)- The hostname of the application.
- this value can also be override by
-DHUMIO_HOSTNAME
orHUMIO_HOSTNAME
as ENVIRONMENT variable
additionalLogEntryValues
(default:DATE,LEVEL,RENDERED_LOG_ENTRY
)- Additional information for log messages, see
LogEntryValue
.
- Additional information for log messages, see
staticFields
(default:EMPTY
)- Additional static fields/tags to be attached to ever log entry
batchActions
(default:100
)- size of events if reached should flush to backend (set to
1
to flush evert log entry.. caution 1 log event 1 http call)
- size of events if reached should flush to backend (set to
batchFlushInterval
(default:5000
)- interval (ms) if reached should flush to backend
batchBufferLimit
(default:1000
)- max size of events to submit in one http call
Additional configuration settings are supported by the HumioWriter
class. Please consult the Javadoc for details.
tinylog2-humio
can be configured using a configuration-file.
Properties file example:
writer2=humio
writer2.serverToken=INGESTION_TOKEN_HERE
writer2.hostname=fancy-app
writer2.staticFields=#type:tinylog2
writer2.format={level}: {class} - {message}
writer2.additionalLogEntryValues=EXCEPTION,FILE,LINE
This project is available on Maven Central. To add it to your project simply add the following dependencies to your
pom.xml
:
<dependency>
<groupId>com.github.chaudhryfaisal</groupId>
<artifactId>tinylog2-humio</artifactId>
<version>1.0.0</version>
</dependency>
You could also add tinylog2
log parser (same as #type
from writer2.staticFields=#type:tinylog2
) to parseand cleanup logs. Read More:
parseJson() |
@rawstring := message |
drop([message]) |
kvParse()
Please file bug reports and feature requests in GitHub issues.
Copyright (c) 2020 Faisal Chaudhry
This library is licensed under the Apache License, Version 2.0.
See http://www.apache.org/licenses/LICENSE-2.0.html or the LICENSE file in this repository for the full license text.