Moocar/logback-gelf — Issue #4: logback-gelf fails if gson is not in classpath
Author: c-rack
Created: 2012-01-18 16:13:47+00:00
State: open

I am using https://github.com/downloads/Moocar/logback-gelf/logback-gelf-0.9.6.jar in a fresh Java maven project. I had to upload the jar in my own maven repository (nexus), because the jar is not available in any public maven repository yet.

On startup, I get the following error:

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder
at me.moocar.logbackgelf.GelfConverter.(GelfConverter.java:42)
at me.moocar.logbackgelf.GelfAppender.initExecutor(GelfAppender.java:86)
at me.moocar.logbackgelf.GelfAppender.start(GelfAppender.java:60)

In order to solve this, I had to add the following dependency to my pom.xml:

``
`	com.google.code.gson`
`	gson`
`	2.1`
``