Is anything else configuring log4j also? Running with -Dlog4j.debug should
help determine that.
I would guess that if you changed your console appender to a file appender
then the file would have the data that you want and the console would have
that data without the dates.
On Nov 15, 2007 9:59 AM, Jim the Standing Bear <[EMAIL PROTECTED]>
wrote:
> Well, here comes the punch line: that WAS the entire log4j.properties
> file... and that is why I have been scratching my head for the past
> several days.
>
> > > [code]
> > > log4j.logger.com.mydomain.myapp=TRACE, myconsole
> > >
> > > log4j.appender.myconsole=org.apache.log4j.ConsoleAppender
> > > log4j.appender.myconsole.Threshold=TRACE
> > > log4j.appender.myconsole.layout=org.apache.log4j.PatternLayout
> > > log4j.appender.myconsole.layout.ConversionPattern=%-34d{DATE} [%t]
> %-5p %c %x -%m%n
> > > [/code]
> > >
>
>
> On Nov 15, 2007 9:58 AM, James A. N. Stauffer <[EMAIL PROTECTED]>
> wrote:
> > It appears that something else is sending the data to the console also.
> > Posting your whole log4j.properties might help us find the problem.
> >
> > On Nov 14, 2007 9:21 PM, Jim the Standing Bear <[EMAIL PROTECTED]>
> > wrote:
> >
> >
> > > Hi,
> > >
> > > I have been scratching my head trying to figure out why my application
> > > is logging everything twice.
> > >
> > > Below is the log4j.properties file
> > >
> > > [code]
> > > log4j.logger.com.mydomain.myapp=TRACE, myconsole
> > >
> > > log4j.appender.myconsole=org.apache.log4j.ConsoleAppender
> > > log4j.appender.myconsole.Threshold=TRACE
> > > log4j.appender.myconsole.layout=org.apache.log4j.PatternLayout
> > > log4j.appender.myconsole.layout.ConversionPattern=%-34d{DATE} [%t]
> > > %-5p %c %x -%m%n
> > > [/code]
> > >
> > > But whenever I run it, it would log two lines of everything, one with
> > > the time, the next one without
> > >
> > > [code]
> > >
> > > 14 Nov 2007 22:09:12,558 [main] INFO
> > > com.mydomain.myapp.util.Util -Property CONNECTION_POOL_SIZE = 5
> > > [main] INFO util.Util - Property CONNECTION_POOL_SIZE = 5
> > > 14 Nov 2007 22:09:12,558 [main] INFO
> > > com.mydomain.myapp.util.Util -Property BROKER_COUNT = 1
> > > [main] INFO util.Util - Property BROKER_COUNT = 1
> > >
> > > [/code]
> > >
> > > However, if I comment out either one of the last two lines in the
> > > properties file, i.e. either specifying PatternLayout, or specifying
> > > ConversionPattern, but not both, it would print only a single line,
> > > however, the date-time stamp will never be present in such cases. And
> > > of course, if the line that specified PatternLayout was commented out,
> > > it also generated errors. So I dont understand what I did wrong.
> > > Please help. Thanks.
> > >
> > > [code]
> > > log4j:ERROR Could not find value for key
> log4j.appender.myconsole.layout
> > > log4j:ERROR No layout set for the appender named [myconsole].
> > >
> > > [main] INFO util.Util - Property CONNECTION_POOL_SIZE = 5
> > > [main] INFO util.Util - Property BROKER_COUNT = 1
> > >
> > > [/code]
> > >
> > >
> > > -- jim
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > James A. N. Stauffer http://www.geocities.com/stauffer_james/
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
>
>
>
> --
> --------------------------------------
> Standing Bear Has Spoken
> --------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
James A. N. Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/