You could write your own pattern converter to expose the a DateTime
object:

<header type="log4net.Util.PatternString">
 <converter>
  <name value="dateTimeNow" />
  <type value="Company.Project.Logging.DateTimePatternConverter,
Company.Project" />
 </converter>
 <conversionPattern value="[BEGIN LOGGING AT %dateTimeNow{hh:mm}]%n" />
</header>

I agree that that's a lot of code for just wanting to print out the
current date and time :-/

Perhaps a built-in pattern called %now could be added that accepts a
DateTime format:

 %now{d}
 %now{hh:mm:ss}

- Ron

--- Russell Haley <[EMAIL PROTECTED]> wrote:

> I'm trying ot insert the date and time in the header footer blocks of
> my
> log. I did a search on the mailing list but didn't find anything.
> 
> I have tried %d, %date and \d without any success.
> 
>  <param name="Header" value="[BEGIN LOGGING AT \d]\r\n" />
>  <param name="Footer" value="[END LOGGING AT \d]\r\n" />
> 
> Suggestions?
> 
> Thanks!
> 
> Russ
> 
> 

Reply via email to