Sending application logs using Logs4j from Windows client machines to Graylog server

Hello,

I’m a newbie to Graylog and am trying to figure out how to send our application logs written using the Logs4j library to Graylog.
As of now our logs are generated in XML format onto the local hard disk.

My questions are:

  1. What would be the best way to send Windows application logs written using Logs4j to the Graylog server?

  2. I’m aware that Log4j can write in GELF format:

https://logging.apache.org/log4j/2.x/manual/layouts.html#GELFLayout
but what would be the best recommended approach?

Thanks in advance,
JY_DT

if you already have log4j, you can decide if you want to send the logs directly to Graylog (using GELF) or to write them to disk and read that logfile with a collector that sends the logs to Graylog.

If you decide for the second option. Do not user xml.

I would need to explore both options further.

  1. How do we send them to Graylog from our application using Logs4j?

  2. In our application, we generate XML logs to disk using Log4j. What collectors, etc can I use to send to Graylog. If XML is not recommended what format should the log be generated in?

Thanks.

he @JY_DT

your first question can be answered by a little search - for example like here: https://stackoverflow.com/questions/26847569/how-to-get-gelfj-appender-work-in-log4j

I would use json or plain log do disk. xml is not easy readable …

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.