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"  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
> > 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 our event to have a specific format by default then I guess we need
> to
> > code that in toString()/ToString(), correct?
> >
> > Thanks,
> > Nick
> >
>



-- 
Matt Sicker 


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 our event to have a 
>specific format by default then I guess we need to code that in 
>toString()/ToString(), correct?

Thanks,
Nick
  

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
> 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 our event to have a specific format by default then I guess we need to
> code that in toString()/ToString(), correct?
>
> Thanks,
> Nick
>


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 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"  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
> > > 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 our event to have a specific format by default then I guess we
> need
> > to
> > > code that in toString()/ToString(), correct?
> > >
> > > Thanks,
> > > Nick
> > >
> >
>
>
>
> --
> Matt Sicker 
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition

JUnit in Action, Second Edition 
Spring Batch in Action 
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory