logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim the Standing Bear" <standingb...@gmail.com>
Subject Re: please help. everything logged twice
Date Thu, 15 Nov 2007 18:40:50 GMT
Thanks James,

I didn't know about the log4j.debug property.  As it turned out, the
app was also using cog-jglobus-1.4, which not only has an
implementation of the log4j of its own, as well as its own
log4j.properties file zipped in the jar! After I repackaged this jar,
it worked like a charm!! Wow.  Thanks!

-- Jim

On Nov 15, 2007 11:07 AM, James A. N. Stauffer <stauffer.james@gmail.com> wrote:
> 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 <standingbear@gmail.com>
>
> 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 <stauffer.james@gmail.com>
> > 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 <standingbear@gmail.com>
> > > 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: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > 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: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>
> --
> 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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message