Logging


(Mats Norén) #1

Hi,
I'm trying to integrate an elasticsearch localnode in a project of mine.

I keep getting this error:

52309 [btpool0-4] ERROR org.mortbay.log - Nested in
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z:
java.lang.NoSuchMethodError: org.slf4j.Logger.isTraceEnabled()Z
at org.elasticsearch.common.logging.slf4j.Slf4jESLogger.isTraceEnabled(Slf4jESLogger.java:42)
at org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
at org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
at org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
at org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
at org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
at org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:147)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at se.zvingon.data.elastic.ElasticDataStore.initLocalNode(ElasticDataStore.java:57)

It seems to me that I'm missing the correct version of Log4J?

Tried to find which dependencies ES 0.17.4 has on Log4J but couldn't
find any, which seems weird.

Any suggestions?

Best regards,
Mats


(Shay Banon) #2

Seems like you have slf4j in the classpath, so elasticsearch will use that
one by default, and it seems like its missing a method on slf4j, I am
guessing because of an old version of slf4j?

On Sat, Aug 13, 2011 at 1:10 PM, Mats Norén mats.noren@gmail.com wrote:

Hi,
I'm trying to integrate an elasticsearch localnode in a project of mine.

I keep getting this error:

52309 [btpool0-4] ERROR org.mortbay.log - Nested in
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z:
java.lang.NoSuchMethodError: org.slf4j.Logger.isTraceEnabled()Z
at
org.elasticsearch.common.logging.slf4j.Slf4jESLogger.isTraceEnabled(Slf4jESLogger.java:42)
at
org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
at
org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
at
org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
at
org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
at
org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
at
org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
at
org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at
org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
at
org.elasticsearch.node.internal.InternalNode.(InternalNode.java:147)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at
se.zvingon.data.elastic.ElasticDataStore.initLocalNode(ElasticDataStore.java:57)

It seems to me that I'm missing the correct version of Log4J?

Tried to find which dependencies ES 0.17.4 has on Log4J but couldn't
find any, which seems weird.

Any suggestions?

Best regards,
Mats


(Mats Norén) #3

Hi, Shay
I've got:
slf4j-api-1.5.8.jar
log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

Is slf4j-api to old?

/M

On Sat, Aug 13, 2011 at 12:26 PM, Shay Banon kimchy@gmail.com wrote:

Seems like you have slf4j in the classpath, so elasticsearch will use that
one by default, and it seems like its missing a method on slf4j, I am
guessing because of an old version of slf4j?

On Sat, Aug 13, 2011 at 1:10 PM, Mats Norén mats.noren@gmail.com wrote:

Hi,
I'm trying to integrate an elasticsearch localnode in a project of mine.

I keep getting this error:

52309 [btpool0-4] ERROR org.mortbay.log - Nested in
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z:
java.lang.NoSuchMethodError: org.slf4j.Logger.isTraceEnabled()Z
at
org.elasticsearch.common.logging.slf4j.Slf4jESLogger.isTraceEnabled(Slf4jESLogger.java:42)
at
org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
at
org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
at
org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
at
org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
at
org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
at
org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
at
org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at
org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
at
org.elasticsearch.node.internal.InternalNode.(InternalNode.java:147)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at
se.zvingon.data.elastic.ElasticDataStore.initLocalNode(ElasticDataStore.java:57)

It seems to me that I'm missing the correct version of Log4J?

Tried to find which dependencies ES 0.17.4 has on Log4J but couldn't
find any, which seems weird.

Any suggestions?

Best regards,
Mats


(Mats Norén) #4

Btw, I'm trying to run elasticsarch embedded into a webapplication run by Jetty.

log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

are in the jetty distribution and slf4j-api is in my WEB-INF/lib
together with ES

/M

On Sat, Aug 13, 2011 at 12:34 PM, Mats Norén mats.noren@gmail.com wrote:

Hi, Shay
I've got:
slf4j-api-1.5.8.jar
log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

Is slf4j-api to old?

/M

On Sat, Aug 13, 2011 at 12:26 PM, Shay Banon kimchy@gmail.com wrote:

Seems like you have slf4j in the classpath, so elasticsearch will use that
one by default, and it seems like its missing a method on slf4j, I am
guessing because of an old version of slf4j?

On Sat, Aug 13, 2011 at 1:10 PM, Mats Norén mats.noren@gmail.com wrote:

Hi,
I'm trying to integrate an elasticsearch localnode in a project of mine.

I keep getting this error:

52309 [btpool0-4] ERROR org.mortbay.log - Nested in
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z:
java.lang.NoSuchMethodError: org.slf4j.Logger.isTraceEnabled()Z
at
org.elasticsearch.common.logging.slf4j.Slf4jESLogger.isTraceEnabled(Slf4jESLogger.java:42)
at
org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
at
org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
at
org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
at
org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
at
org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
at
org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
at
org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at
org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
at
org.elasticsearch.node.internal.InternalNode.(InternalNode.java:147)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at
se.zvingon.data.elastic.ElasticDataStore.initLocalNode(ElasticDataStore.java:57)

It seems to me that I'm missing the correct version of Log4J?

Tried to find which dependencies ES 0.17.4 has on Log4J but couldn't
find any, which seems weird.

Any suggestions?

Best regards,
Mats


(Shay Banon) #5

Donno regarding the slf4j version, you need to check. If you want to force
elasticsearch to use log4j, you can do:

ESLoggerFactory.setDefaultFactory(new Log4jESLoggerFactory()); before you do
anything with elasticsearch (in a static init block for example).

On Sat, Aug 13, 2011 at 1:36 PM, Mats Norén mats.noren@gmail.com wrote:

Btw, I'm trying to run elasticsarch embedded into a webapplication run by
Jetty.

log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

are in the jetty distribution and slf4j-api is in my WEB-INF/lib
together with ES

/M

On Sat, Aug 13, 2011 at 12:34 PM, Mats Norén mats.noren@gmail.com wrote:

Hi, Shay
I've got:
slf4j-api-1.5.8.jar
log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

Is slf4j-api to old?

/M

On Sat, Aug 13, 2011 at 12:26 PM, Shay Banon kimchy@gmail.com wrote:

Seems like you have slf4j in the classpath, so elasticsearch will use
that

one by default, and it seems like its missing a method on slf4j, I am
guessing because of an old version of slf4j?

On Sat, Aug 13, 2011 at 1:10 PM, Mats Norén mats.noren@gmail.com
wrote:

Hi,
I'm trying to integrate an elasticsearch localnode in a project of
mine.

I keep getting this error:

52309 [btpool0-4] ERROR org.mortbay.log - Nested in
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z:
java.lang.NoSuchMethodError: org.slf4j.Logger.isTraceEnabled()Z
at

org.elasticsearch.common.logging.slf4j.Slf4jESLogger.isTraceEnabled(Slf4jESLogger.java:42)

   at

org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)

   at

org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)

   at

org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)

   at

org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)

   at

org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)

   at

org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)

   at

org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)

   at

org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at

org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)

   at

org.elasticsearch.node.internal.InternalNode.(InternalNode.java:147)

   at

org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)

   at

se.zvingon.data.elastic.ElasticDataStore.initLocalNode(ElasticDataStore.java:57)

It seems to me that I'm missing the correct version of Log4J?

Tried to find which dependencies ES 0.17.4 has on Log4J but couldn't
find any, which seems weird.

Any suggestions?

Best regards,
Mats


(Mats Norén) #6

Thanks!
It was the slf4j-simple-1.0.1.jar that was too old.

/M

On Sat, Aug 13, 2011 at 12:42 PM, Shay Banon kimchy@gmail.com wrote:

Donno regarding the slf4j version, you need to check. If you want to force
elasticsearch to use log4j, you can do:
ESLoggerFactory.setDefaultFactory(new Log4jESLoggerFactory()); before you do
anything with elasticsearch (in a static init block for example).

On Sat, Aug 13, 2011 at 1:36 PM, Mats Norén mats.noren@gmail.com wrote:

Btw, I'm trying to run elasticsarch embedded into a webapplication run by
Jetty.

log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

are in the jetty distribution and slf4j-api is in my WEB-INF/lib
together with ES

/M

On Sat, Aug 13, 2011 at 12:34 PM, Mats Norén mats.noren@gmail.com wrote:

Hi, Shay
I've got:
slf4j-api-1.5.8.jar
log4j-1.2.16.jar
slf4j-simple-1.0.1.jar

Is slf4j-api to old?

/M

On Sat, Aug 13, 2011 at 12:26 PM, Shay Banon kimchy@gmail.com wrote:

Seems like you have slf4j in the classpath, so elasticsearch will use
that
one by default, and it seems like its missing a method on slf4j, I am
guessing because of an old version of slf4j?

On Sat, Aug 13, 2011 at 1:10 PM, Mats Norén mats.noren@gmail.com
wrote:

Hi,
I'm trying to integrate an elasticsearch localnode in a project of
mine.

I keep getting this error:

52309 [btpool0-4] ERROR org.mortbay.log - Nested in
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z:
java.lang.NoSuchMethodError: org.slf4j.Logger.isTraceEnabled()Z
at

org.elasticsearch.common.logging.slf4j.Slf4jESLogger.isTraceEnabled(Slf4jESLogger.java:42)
at

org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
at

org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
at

org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
at

org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
at

org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
at

org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
at

org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at
org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at

org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
at

org.elasticsearch.node.internal.InternalNode.(InternalNode.java:147)
at
org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at

se.zvingon.data.elastic.ElasticDataStore.initLocalNode(ElasticDataStore.java:57)

It seems to me that I'm missing the correct version of Log4J?

Tried to find which dependencies ES 0.17.4 has on Log4J but couldn't
find any, which seems weird.

Any suggestions?

Best regards,
Mats


(James Cook) #7

I can't tell you that your version of SLF4J is too old, but we use 1.6.1
just fine.


(James Cook) #8

There are a number of other problems also:

  1. Your SLF4J Simple logger should match the version number of SLF4J.
  2. In order to use Log4J with SLF4J, you need the slf4j-log4j12 bridge.
  3. You wouldn't use simple logger and log4j typically. They are both
    the parts of the infrastructure that actually write the messges.

-- jim


(system) #9