I am writing this to seek for your support and idea as well.
I’m implementing Log4j2 to console application event. In every event, I want to sent log data to Graylog by which input type available in Graylog.
Because log data is no any format, only plaintext as following
2024-02-26T10:44:29.271+0700 DEBUG ==> Preparing: …
I am not sure whether it is possible way to send that such log message to Graylog input or not. I’ve tried with Syslog and GELF/TCP, those are required specific format.
Can anyone recommend how can I send log to Graylog in Log42j ?
How are you sending data to graylog? Is there a specific appender you are using? The graylog input will need to match however the log is being sent. For exmaple, if you are sending RFC compliant syslog you would need to use the appropriate UDP or TCP syslog input.
You can also try experimenting with the raw/plaintext input.
I am trying to send log message to Graylog via Raw/Plaintext TCP input.
Log message is configured by Log4j2 under Spring boot application.
Sending log I prefer to use socket and using buffer size for wrap the message and send to the server only once time. Below is code suggestion from another source.