Re: Query Regarding Log4j audit framework

2020-02-27 Thread Ralph Goers
Log4j Audit uses Log4j so anything built into Log4j can be used. So I can think of a couple of ways to inject a hash: 1. Add the hash to your layout. If you used the PatternLayout you could implement a HashConverter to create it. In general, I suspect you should create a Jira issue for whichever

Re: Query Regarding Log4j audit framework

2020-02-27 Thread Matt Sicker
Ah, I see what you mean. I don’t think we have any specific plugin for that, though they sound like reasonable feature requests. Could you file Jira tickets for them? On Thu, Feb 27, 2020 at 03:09 Sushil Singh wrote: > Thanks @Matt Sicker for your reply > > But 2 of my problems remains unresolv

Re: PatternLayout Log4j2

2020-02-27 Thread Matt Sicker
One thing to keep in mind is that unless you’re willing to keep updating code based on internal changes, you shouldn’t be creating plugin objects directly from their builder classes or factory methods. The programmatic config has a few examples in our unit tests. On Thu, Feb 27, 2020 at 09:38 EDMO

Re: PatternLayout Log4j2

2020-02-27 Thread EDMONDO SENA
I saw it but not everything in that examples is clear to me... On 2020/02/27 15:33:56, Matt Sicker wrote: > http://logging.apache.org/log4j/2.x/manual/customconfig.html > > > On Thu, Feb 27, 2020 at 09:32 EDMONDO SENA wrote: > > > > > Is it possible to do it in java code without configurat

Re: PatternLayout Log4j2

2020-02-27 Thread Matt Sicker
http://logging.apache.org/log4j/2.x/manual/customconfig.html On Thu, Feb 27, 2020 at 09:32 EDMONDO SENA wrote: > > Is it possible to do it in java code without configuration file? > > > > On 2020/02/27 15:28:26, Ralph Goers wrote: > > Why are you using the PatternLayout with the SyslogAppender

Re: PatternLayout Log4j2

2020-02-27 Thread EDMONDO SENA
Is it possible to do it in java code without configuration file? On 2020/02/27 15:28:26, Ralph Goers wrote: > Why are you using the PatternLayout with the SyslogAppender? If you replace > the Layout it will no longer be sending data in accordance with the Syslog > spec. Why are you doing

Re: PatternLayout Log4j2

2020-02-27 Thread Ralph Goers
Why are you using the PatternLayout with the SyslogAppender? If you replace the Layout it will no longer be sending data in accordance with the Syslog spec. Why are you doing this programmatically instead of using a configuration file? Ralph > On Feb 27, 2020, at 8:25 AM, EDMONDO SENA wrot

Re: PatternLayout Log4j2

2020-02-27 Thread EDMONDO SENA
I've used: Call -> final Builder builder2 = newSyslogAppenderBuilder(protocol, format, newLine); protected static Builder newSyslogAppenderBuilder(final String protocol,final String format,final boolean newLine) return Syslog4jAppenderLI.newSyslogAppenderBuilder() .wi

Re: PatternLayout Log4j2

2020-02-27 Thread Ralph Goers
I am not sure what you mean by “regular expression” with regards to the PatternLayout as it doesn’t use regular expressions. Have you tried the same pattern? My guess is it should do the same thing Log4j 1 did. Ralph > On Feb 27, 2020, at 2:25 AM, EDMONDO SENA wrote: > > > Hi Everybody, >

Re: how to fix version mismatch error

2020-02-27 Thread Ralph Goers
The exception is coming from Netty, not Log4j 2. You would have to look at the Log4j2Logger class there and find out why it is throwing an exception. Ralph > On Feb 27, 2020, at 1:35 AM, Sandeep Gupta wrote: > > Hello, > > I am new to java ecosystem and was handed this small code which > laun

PatternLayout Log4j2

2020-02-27 Thread EDMONDO SENA
Hi Everybody, In log4j1.x I was using the PatternLayout(String Pattern) namely: - setLayout(new PatternLayout("%d %-lp - %m"). Now I didn't understand the equivalent of making this regular expression in log4j2. Can you help me understand better? --

Re: Query Regarding Log4j audit framework

2020-02-27 Thread Sushil Singh
Thanks @Matt Sicker for your reply But 2 of my problems remains unresolved 1) How can i add hash of the log itself and send it with log itself as a Log field so that we can verify it for tampering at a later stage 2) How can i aggregate log events for count along with lo

how to fix version mismatch error

2020-02-27 Thread Sandeep Gupta
Hello, I am new to java ecosystem and was handed this small code which launches a webserver. It gives a log4j version mismatch error that I am not able to debug further. For compilation, I am using log4j 2.12.1 version. java.lang.ExceptionInInitializerError application stacktrace Caused by: