Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

log4j syslog appender don't load #527

luddic opened this issue Nov 19, 2010 · 5 comments

Comments

@luddic
Copy link

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

@kimchy
Copy link
Member

kimchy commented Nov 19, 2010

How do you configure it?

@luddic
Copy link
Author

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"

@kimchy
Copy link
Member

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.

@kimchy
Copy link
Member

kimchy commented Nov 19, 2010

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

@luddic
Copy link
Author

luddic commented Nov 20, 2010

Thanks

medcl pushed a commit to medcl/elasticsearch that referenced this issue Jul 1, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
jev001 pushed a commit to jev001/elasticsearch that referenced this issue Dec 28, 2022
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants