Skip to content

moderntv/zerolog-lumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zerolog Logstash writer

This writer communicates with default logstash beats input. As zerolog default writes the output in json the logstash input uses json codec.

Logstash go client

This zerolog logstash writer uses go-lumber client. For more info visit go-lumber repository. As the client is non blocking, it uses buffer channel where each write processes the input and stores the result into buffer. The asynchronous worker then processes the buffer when is full or when Flush is called, e.g:

lw.Flush(1*time.Second)

When the Flush is not called, the last bufferSize messages are definitelly lost. When the program wants to avoid using flushing, pass the context of the main function into worker so it flushes the stream at the end of program.

Tests

Tests are written with locally hosted logstash service. To run tests there have to be spawned logstash service before running tests locally. Simply run docker compose and tests

docker compose up -d
go test ./...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages