logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Göran Roseen <go...@roseen.se>
Subject RE: PatternLayout - add time increment
Date Tue, 22 Nov 2005 09:24:32 GMT

OK, Urban, I understand. I don't think you will find what you are looking
for inside the framework though.

Just a question; since you use the short form format specifier "%r", does
this mean that you use the old version 1.2.8? Or are you using 1.2.9?

(It took me a while to find the list of format specifiers but they are here:


My way to solve your problem would be to use %timestamp (or %r if you want),
and then process the log file separately. It would be quite easy to
calculate the differences, using Excel for example.

A (really small) note to our maintainers (Nicko et al.):

The text on the manual page mentioned above says:

"Each conversion specifier starts with a percent sign (%) and is followed by
optional format modifiers and a conversion character. The conversion
character specifies the type of data, e.g. logger, level, date, thread

"A conversion character" is not correct any more is it?


Göran Roseen

-----Original Message-----
From: Urban Jaroslav, Ing. [mailto:urban@asd-software.cz] 
Sent: den 22 november 2005 10:03
To: log4net-user@logging.apache.org
Subject: RE: PatternLayout - add time increment

2 Göran Roseen
Thanx for tip, but it is not exactly what I am looking for. This timestamp
just shows the time increment since logging is started. I am looking rather
for time difference between logged events.

I found that for timestamp can be used char r, which is inserted in
PatternLayout. Did you mean this?

r - Used to output the number of milliseconds elapsed since the start of the
application until the creation of the logging event. 

2 Nicko Cadell
Just difference between actual event and event called before. See better
example (see values in first bracket column):

2005-11-08 11:15:42,106 [0,012] [3444] INFO  XmlService --->GetSoapBody
2005-11-08 11:15:42,341 [0,235] [3444] INFO  XmlService --->XSDValidation
2005-11-08 11:15:45,652 [3,311] [3444] INFO  XmlService --->XSLTValidation

Then I can see the highest values of time increment, which I am interested

-----Original Message-----
From: Urban Jaroslav, Ing. 
Sent: Tuesday, November 08, 2005 12:24 PM
To: log4net-user@logging.apache.org
Subject: PatternLayout - add time increment

Hi all,
 	I looked for solution how I could insert to log file an time
increment consecutive records. As I studied the PatternLayout for
log4net, found no possibility to achieve it.
	Is there anyone who solved it or it is not possible?

	Thanks for any response, bye Jaroslav Urban

An example:
2005-11-08 11:15:42,106 [0,000] [3444] INFO  XmlService [] -
2005-11-08 11:15:42,106 [0,000] [3444] INFO  XmlService [] -
2005-11-08 11:15:43,106 [1,000] [3444] INFO  XmlService [] -

- log4net v1.1.1.33753
- IIS project
- using Dot.Net Fr1.1

View raw message