Missing zero byte (\0) character at end of GELF TCP message from docker container's gelf driver

122 views Asked by At

We are using Logback for our Spring boot microservice and pushing logs to graylog using docker logging driver - gelf.

We have configured the logging driver to use tcp route to push logs to graylog as the same can be reliable over udp.

From the graylog docs here, it is evident that

Each message needs to be delimited with a null byte (\0) when sent in the same TCP connection.

The logging is working fine for most cases, but the log lines that are at the end of the actual service (when there is no more messages to be pushed to graylog) is not being pushed to graylog, mainly due to the missing null byte (\0) character at the end.

Is there any way to force gelf driver to send null byte at the end of log message though tcp?

or

Is it possible to handle such case in logback (currently using LoggingEventCompositeJsonEncoder as encoder)

0

There are 0 answers