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

Layout does not work with Log4J2 #39

Open
chadcampbell opened this issue Apr 10, 2014 · 11 comments
Open

Layout does not work with Log4J2 #39

chadcampbell opened this issue Apr 10, 2014 · 11 comments

Comments

@chadcampbell
Copy link

Hello,

Logstash does not have an input plugin that works with Log4J2. When attempting to use the log4j-jsonevent-layout with an app that uses Log4J2, an error is thrown. That error is:

...contains an invalid element or attribute "layout".

There does not appear to be a workaround for getting log4j2 content into a json format that logstash can understand.

@lusis
Copy link
Contributor

lusis commented Sep 9, 2014

hrmmm. I wonder if I can make this conditional/detectable. It may need to be a new version. I'll investigate.

@jameskennard
Copy link

Was wondering if this is something that is likely to be dealt with in the foreseeable future?

Thanks

@ov7a
Copy link

ov7a commented May 20, 2015

@michaelkuechler
Copy link

created a pullrequest that addresses the issue: #56

@ghost
Copy link

ghost commented Jun 22, 2015

Can we expect this to be dealt with anytime soon?

@robpc
Copy link

robpc commented Dec 2, 2015

+1

2 similar comments
@loicmathieu
Copy link

+1

@alessandrobenedetti
Copy link

+1

@batghare
Copy link

Any updates on this ? is this available ? It's not working for me for log4j2

@br0ch0n
Copy link

br0ch0n commented Mar 10, 2017

@batghare the fork-of-a-fork https://github.com/DNSBelgium/log4j-jsonevent-layout works for me for log4j v2, e.g.

<configuration packages="net.logstash.log4j2" monitorInterval="60">
<appenders>
  <Socket name="LogStashSocket" host="logserver01" port="4561" protocol="tcp">
        <JSONEventLayoutV1 userFields="region:us-east-1a, application:myapp">
        </JSONEventLayoutV1>
  </Socket>
</appenders>
<loggers>
    <root level="info"> <!-- We log everything -->
        <appender-ref ref="LogStashSocket"/>
    </root>
</loggers>
</configuration>

Also, in my case (dropping it into an already-built project (storm)) the uber-jar didn't work, likely due to https://issues.apache.org/jira/browse/LOG4J2-673, so I had to manually drop in json-smart-1.1.1.jar and commons-lang-2.6.jar., just FYI. Probably not an issue for one's own code.

@callumcodes
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests