Re: layout optional?

2015-11-10 Thread Matt Sicker
Usually it's very minimal information like the log message and no metadata. On 10 November 2015 at 09:53, Gary Gregory wrote: > Log4j Appenders usually create a default layout if one is not configured. > > Gary > On Nov 10, 2015 7:22 AM, "Nicholas Duane"

Re: Log entries written to wrong file

2015-11-10 Thread Chinh Do
The manual (http://logging.apache.org/log4j/2.x/manual/logsep.html) says you can follow step (3) below to get log separation. I am not clear on what values to set for log4jContextName and log4jConfiguration, or how exactly to do it on WebSphere 8.5 Has anyone done this? Really appreciate any help

Re: Change log level on the fly?

2015-11-10 Thread Gary Gregory
The Configurator class had APIs just for this purpose. Gary On Nov 9, 2015 10:26 PM, "Matt Sicker" wrote: > Oh, good catch, never used the API like that outside of unit tests. > > On 9 November 2015 at 23:21, Ralph Goers > wrote: > > > Matt, the

layout optional?

2015-11-10 Thread Nicholas Duane
>From reading the log4j2/log4net docs it appears adding a layout to an appender >is optional. If I don't add a layout to an appender how does the appender >generate the string for the event? Does it simply call toString()/ToString() >on the event object? If that's the case then if we want

Re: layout optional?

2015-11-10 Thread Gary Gregory
Log4j Appenders usually create a default layout if one is not configured. Gary On Nov 10, 2015 7:22 AM, "Nicholas Duane" wrote: > From reading the log4j2/log4net docs it appears adding a layout to an > appender is optional. If I don't add a layout to an appender how does the >

Re: Log4j2 - HTML emails pattern

2015-11-10 Thread Benjamin Jaton
I am trying to use a logger in order to send "alerts" to the user. So for me 1 log = 1 email (hence LOG4J2-1071). I use the regular PatternLayout to produce a simple but full HTML page with my alert email template. For the HTMLLayout to be usable, it would have to allow to customize the pattern,

RollingFileAppender maxDelayMillis?

2015-11-10 Thread Benjamin Jaton
Hi, I am wondering if it would make sense to have a maxDelayMillis parameter for the RollingFileAppender (like FlumeAppender). Use case: You have a web server access log, you produce an HTTP request and expect to see it (and the response) in the access logs right away-ish (or at least control

Re: layout optional?

2015-11-10 Thread Gary Gregory
But sometimes it's a little more ;-) See org.apache.logging.log4j.core.config.DefaultConfiguration.DEFAULT_PATTERN Gary On Tue, Nov 10, 2015 at 8:32 AM, Matt Sicker wrote: > Usually it's very minimal information like the log message and no metadata. > > On 10 November 2015

Re: RollingFileAppender maxDelayMillis?

2015-11-10 Thread Gary Gregory
And more generally, can all appenders benefit from such a setting? Gary On Tue, Nov 10, 2015 at 11:04 AM, Benjamin Jaton wrote: > Hi, > > I am wondering if it would make sense to have a maxDelayMillis parameter > for the RollingFileAppender (like FlumeAppender). > >

Re: RollingFileAppender maxDelayMillis?

2015-11-10 Thread Remko Popma
To check my understanding: the problem is that with bufferedIO=true the buffer contains log events that you want to see, but the buffer is only flushed to disk when it is full (which is not frequent enough); is that correct? If you use AsyncAppender or Async Loggers, the buffer will be flushed

Re: RollingFileAppender maxDelayMillis?

2015-11-10 Thread Remko Popma
On Wed, Nov 11, 2015 at 2:34 PM, Benjamin Jaton wrote: > On Tue, Nov 10, 2015 at 6:13 PM, Remko Popma > wrote: > > > To check my understanding: the problem is that with bufferedIO=true the > > buffer contains log events that you want to see, but

Re: Log4j2 - HTML emails pattern

2015-11-10 Thread Matt Sicker
It seems abusive, but couldn't you just use the PatternLayout and interweave HTML? On 10 November 2015 at 11:57, Benjamin Jaton wrote: > I am trying to use a logger in order to send "alerts" to the user. So for > me 1 log = 1 email (hence LOG4J2-1071). > I use the

Re: RollingFileAppender maxDelayMillis?

2015-11-10 Thread Benjamin Jaton
On Tue, Nov 10, 2015 at 6:13 PM, Remko Popma wrote: > To check my understanding: the problem is that with bufferedIO=true the > buffer contains log events that you want to see, but the buffer is only > flushed to disk when it is full (which is not frequent enough); is that

Re: Log4j2 - HTML emails pattern

2015-11-10 Thread Benjamin Jaton
You mean just put HTML in the pattern directly? You need to content type of the email to be set to text/html, other you would just see the HTML code in the email. On Tue, Nov 10, 2015 at 9:21 PM, Matt Sicker wrote: > It seems abusive, but couldn't you just use the