Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

log to graylog2 by adding external jar to classpath

avatar
New Contributor

Hi,

in order to log errors and stacktraces to Graylog2 I had the following intention

- manually put the https://github.com/Moocar/logback-gelf as a jar into the nifi dir

- add the jar to the classpath

- change the logback config and add the gelf-appender.

Now, nifi.sh is only loading the bootstrap process that runs nifi. So adding the jar to the cp there is no help. Any idea how I can achieve the effect without touching the nifi source and compile myself?

Thanks for the help!

John

1 ACCEPTED SOLUTION

avatar
New Contributor

This works actually, by placing the .jar file into the lib and the lib/bootstrap folder and then just applying the changes to the logback.xml like usually.

<appender name="GELF" class="de.siegmar.logbackgelf.GelfUdpAppender">
  <graylogHost>ip</graylogHost>
  <graylogPort>12201</graylogPort>
</appender>

I am using de.siegmar:logback-gelf/1.0.3.

Issue resolved for me.

View solution in original post

1 REPLY 1

avatar
New Contributor

This works actually, by placing the .jar file into the lib and the lib/bootstrap folder and then just applying the changes to the logback.xml like usually.

<appender name="GELF" class="de.siegmar.logbackgelf.GelfUdpAppender">
  <graylogHost>ip</graylogHost>
  <graylogPort>12201</graylogPort>
</appender>

I am using de.siegmar:logback-gelf/1.0.3.

Issue resolved for me.