Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

log4j syslog appender don't load #527

Closed
luddic opened this Issue Nov 19, 2010 · 5 comments

Comments

Projects
None yet
2 participants

luddic commented Nov 19, 2010

Hi, current elasticsearch cannot use syslog appender in log4j, because of this:

log4j:ERROR Could not instantiate class [org.apache.log4j.SyslogAppender].
java.lang.ClassNotFoundException: org.apache.log4j.SyslogAppender
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.apache.log4j.helpers.Loader.loadClass(Loader.java:179)
    at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:320)
    at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:121)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:664)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
    at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:367)
    at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:111)
    at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:92)
    at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:153)

Correct class must be:
org.apache.log4j.net.SyslogAppender
(not 'log4j.' directly but 'log4j.net.')

Maybe other net. appenders have same problems

Owner

kimchy commented Nov 19, 2010

How do you configure it?

luddic commented Nov 19, 2010

Something like this in logging.yml:

  syslog:
    type: syslog
    sysloghost: 10.11.11.71
    facility: local0
    layout:
      type: pattern
      conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
Owner

kimchy commented Nov 19, 2010

Right, I see where the problem is, will push a fix. For now, you can just specify the full classname in the type, it should work.

Owner

kimchy commented Nov 19, 2010

log4j syslog appender don't load, closed by 03f66b0.

luddic commented Nov 20, 2010

Thanks

medcl pushed a commit to medcl/elasticsearch that referenced this issue Jul 1, 2011

@jkroepke jkroepke referenced this issue in elastic/puppet-elasticsearch Mar 2, 2015

Closed

Add syslog logger support #283

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment