Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 76560 invoked from network); 19 Sep 2005 13:25:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Sep 2005 13:25:42 -0000 Received: (qmail 81614 invoked by uid 500); 19 Sep 2005 13:25:39 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 81575 invoked by uid 500); 19 Sep 2005 13:25:39 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 81560 invoked by uid 99); 19 Sep 2005 13:25:39 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2005 06:25:38 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of RDAVANAG@mobius.com designates 204.126.130.10 as permitted sender) Received: from [204.126.130.10] (HELO rye2kes4.mobius.com) (204.126.130.10) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2005 06:25:48 -0700 Received: by rye2kes4.Mobius.com with Internet Mail Service (5.5.2658.3) id ; Mon, 19 Sep 2005 09:25:35 -0400 Message-ID: <89B3700F1199D411A0CB00508BEE227E10BB6978@ryentes1.mobius.com> From: Ramaa Davanagere To: 'Log4NET User' Subject: RE: Including datetime stamp in the log messages. Date: Mon, 19 Sep 2005 09:25:30 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2658.3) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C5BD1D.9B2511AA" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C5BD1D.9B2511AA Content-Type: text/plain I'm using log4net 1.2.9.0 Right now, my Fileappender output looks like this Void WriteToLog_Info(System.String):busContent.clsSaveContent.Save(): After calling CreateContentCache() Void WriteToLog_Info(System.String):busContent.clsSaveContent.Save() - Leaving Void WriteToLog_Info(System.String):busContent.clsRetrieveContent.Retrieve() - Entering But I want it to look more like this... 2005-08-30 08:56:27,968[120048]INFO busContent.clsSaveContent.Save(): After calling CreateContentCache() 2005-08-30 08:56:27,968[120049]INFO busContent.clsSaveContent.Save(): Leaving 2005-08-30 08:56:27,968[120050]INFO busContent.clsRetrieveContent.Retrieve() - Entering 2005-08-30 08:57:58,890[129088]ERROR busContent.clsRetrieveContent.SetVersionNumber(): Object variable not set 120049 should be the thread id. clsSaveContent and clsRetrieveContent are 2 classes of busContent component. I'm more interested in getting the initial part (2005-08-30 08:56:27,968[120048]INFO) of the message. -----Original Message----- From: Nicko Cadell [mailto:nicko@neoworks.com] Sent: Monday, September 19, 2005 9:04 AM To: Log4NET User Subject: RE: Including datetime stamp in the log messages. Which version of log4net are you using? What does the output of your FileAppender look like at the moment? In your desired output example you have a chunk in square brackets (e.g. [120048]) between the date and the level name, what do you want here? Thread ID? >From your example is "Void WriteToLog_Info(System.String)" part of your log message text? Cheers, Nicko > -----Original Message----- > From: Ramaa Davanagere [mailto:RDAVANAG@mobius.com] > Sent: 19 September 2005 13:56 > To: 'log4net-user@logging.apache.org' > Subject: Including datetime stamp in the log messages. > > > > I'm using a fileappender and logging messages to a text file. > > > > My Fileappender and PatternLayout are set like this... > > > > log4net.Appender.FileAppender oFileAppender = new > log4net.Appender.FileAppender(); > > log4net.Layout.PatternLayout oPatternLayout = new > log4net.Layout.PatternLayout(); > > oPatternLayout.Header = "[Begin]\r\n"; > > oPatternLayout.Footer = "[End]\r\n\r\n"; > > oPatternLayout.ConversionPattern = "%d %-5p %c %m%n"; > > > > But I want the output to look like the sample shown below. I > want to include the datetime stamp for each message that is > logged to the text file followed by the message type > constants (debug, error, fatal, info, etc) and then my log message. > > > > 2005-08-30 08:56:27,968[120048]INFO > MyCompanyName.MyProductName.ErrorHandler - Void > WriteToLog_Info(System.String) about to write a log message > > 2005-08-30 08:57:58,890[129088]ERROR > MyCompanyName.MyProductName.ErrorHandler - Void > WriteToLog_Err(System.String): Object variable not set > > > > Can somebody look at my conversionPattern string and let me > know what is wrong? > > > > Thanks. > > > > ------_=_NextPart_001_01C5BD1D.9B2511AA Content-Type: text/html

I'm using log4net 1.2.9.0

 

Right now, my Fileappender output looks like this

 

Void WriteToLog_Info(System.String):busContent.clsSaveContent.Save(): After calling CreateContentCache()

Void WriteToLog_Info(System.String):busContent.clsSaveContent.Save() - Leaving

Void WriteToLog_Info(System.String):busContent.clsRetrieveContent.Retrieve() - Entering

 

But I want it to look more like this...

 

2005-08-30 08:56:27,968[120048]INFO busContent.clsSaveContent.Save(): After calling CreateContentCache()

2005-08-30 08:56:27,968[120049]INFO busContent.clsSaveContent.Save(): Leaving

2005-08-30 08:56:27,968[120050]INFO busContent.clsRetrieveContent.Retrieve() - Entering

2005-08-30 08:57:58,890[129088]ERROR busContent.clsRetrieveContent.SetVersionNumber(): Object variable not set

 

120049 should be the thread id.

 

clsSaveContent and clsRetrieveContent are 2 classes of busContent component.

 

I'm more interested in getting the initial part (2005-08-30 08:56:27,968[120048]INFO) of the message.

 

 

-----Original Message-----
From: Nicko Cadell [mailto:nicko@neoworks.com]
Sent:
Monday, September 19, 2005 9:04 AM
To: Log4NET User
Subject: RE: Including datetime stamp in the log messages.

 

Which version of log4net are you using?

 

What does the output of your FileAppender look like at the moment?

 

In your desired output example you have a chunk in square brackets (e.g.

[120048]) between the date and the level name, what do you want here?

Thread ID?

 

From your example is "Void WriteToLog_Info(System.String)" part of your

log message text?

 

 

Cheers,

Nicko

 

> -----Original Message-----

> From: Ramaa Davanagere [mailto:RDAVANAG@mobius.com]

> Sent: 19 September 2005 13:56

> To: 'log4net-user@logging.apache.org'

> Subject: Including datetime stamp in the log messages.

>

>

> I'm using a fileappender and logging messages to a text file.

>

>

> My Fileappender and PatternLayout are set like this...

>

>

> log4net.Appender.FileAppender oFileAppender = new

> log4net.Appender.FileAppender();

>

> log4net.Layout.PatternLayout oPatternLayout = new

> log4net.Layout.PatternLayout();

>

> oPatternLayout.Header = "[Begin]\r\n";

>

> oPatternLayout.Footer = "[End]\r\n\r\n";

>

> oPatternLayout.ConversionPattern = "%d %-5p %c %m%n";

>

>

> But I want the output to look like the sample shown below. I

> want to include the datetime stamp for each message that is

> logged to the text file followed by the message type

> constants (debug, error, fatal, info, etc) and then my log message.

>

>

> 2005-08-30 08:56:27,968[120048]INFO 

> MyCompanyName.MyProductName.ErrorHandler - Void

> WriteToLog_Info(System.String) about to write a log message

>

> 2005-08-30 08:57:58,890[129088]ERROR

> MyCompanyName.MyProductName.ErrorHandler - Void

> WriteToLog_Err(System.String): Object variable not set

>

>

> Can somebody look at my conversionPattern string and let me

> know what is wrong?

>

>

> Thanks.

>

>

>

------_=_NextPart_001_01C5BD1D.9B2511AA--