for-linux
for-linux copied to clipboard
Gelf logging driver sends blank short_message
- [x] This is a bug report
- [ ] This is a feature request
- [x] I searched existing issues before opening this one
Expected behavior
The driver should not send the message to the server if the message is empty (current state) or contains only white spaces.
Actual behavior
This issue follows https://github.com/docker/for-linux/issues/354 that solves the case when short_message is empty (length zero).
The current code of graylog validates short_message with function StringUtils.isBlank(). The function comes from Apache Commons. Therefore not only an empty short_message is omitted (and logged as error), but also a short_message with only white spaces. If the docker container produces such messages ("\r" in my case) the graylog log file is still filled with errors.
hi,
I also have the same issue:
- Debian Buster
- docker-ce 5:23.0.1-1~debian.10~buster
docker run --log-driver gelf --log-opt gelf-address=udp://127.0.0.1:12002 --log-opt tag=docker/{{.Name}} --log-opt tag=test alpine echo hello world
Ends in
2023-04-27T13:00:00.900+02:00 ERROR [DecodingProcessor] Unable to decode raw message RawMessage{id=a7ea1712-e4ea-11ed-a7f4-b2dd822c9f33, journalOffset=1982530114, codec=gelf, payloadSize=732, timestamp=2023-04-27T11:00:00.897Z, remoteAddress=/172.16.0.40:38240} on input <5d10c887db412567534abad4>.
2023-04-27T13:00:00.901+02:00 ERROR [DecodingProcessor] Error processing message RawMessage{id=a7ea1712-e4ea-11ed-a7f4-b2dd822c9f33, journalOffset=1982530114, codec=gelf, payloadSize=732, timestamp=2023-04-27T11:00:00.897Z, remoteAddress=/172.16.0.40:38240}
java.lang.IllegalArgumentException: GELF message <a7ea1712-e4ea-11ed-a7f4-b2dd822c9f33> (received from <172.16.0.40:38240>) has empty mandatory "short_message" field.
cu denny