You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Hewitt, Simon C. (Contractor)" <Si...@uk.bp.com> on 2005/05/05 15:00:24 UTC

RE: Header/Footer doesn't recognize patterns?

Is there any way of evaluating it at the time of logging rather than
configuration time?
(I wanted to put a timestamp in the header and the footer)

BTW Two minor items in PatternString.cs
- the s_globalRulesRegistry declaration is for 10 items but 13 are then
added 
- the class documentation has a typo on line 42 ("does does...")


Also, whilst I'm writing to you, what is the reason for 'hiding' the
other built-in levels such as Trace, Verbose, Notice, Emergency etc.?
I've written a LogEx class which:-
1) adds all of the hidden' levels 
2) adds a CustomLevel(Level level, object message) set of methods
3) adds a new level 'public static Level DumpLevel = new Level(5000,
"DUMP");' so I can have an extra level below Trace

All this works fine but I'm intrigued as to why ILog is implemented as
it is.

Cheers
Simon

-----Original Message-----
From: Nicko Cadell [mailto:nicko@neoworks.com] 
Sent: 16 April 2005 20:44
To: Log4NET Dev
Subject: RE: Header/Footer doesn't recognize patterns?


You can use a PatternString in the header or footer, this will be
evaluated at configuration time. For example:

<header type="log4net.Util.PatternString" value="LOG START
processid=%processid" />

(PatternString was introduced in log4net 1.2.9)

Nicko

> -----Original Message-----
> From: Hewitt, Simon C. (Contractor) [mailto:Simon.Hewitt@uk.bp.com]
> Sent: 14 April 2005 13:44
> To: log4net-dev@logging.apache.org
> Subject: Header/Footer doesn't recognize patterns?
> 
> Maybe I'm missing something but patterns I put into the
> header string are logged verbatim.
> Any chance of allowing patterns to be used in headers and footers??
>  
> Simon Hewitt
> BP Shipping (Contractor)
> Mobile - 07973 205241
> --
> (There are 10 kinds of people - those who understand binary
> and those who don't) 
>  
>