Pascal ROZE | 28 Aug 14:41

Use Pattern name in message

Hi all

At this time, I have a logger with the following configuration:
<layout type="log4net.Layout.PatternLayout,log4net">
      <conversionPattern value="LEVEL: %level %newlineDATE: %date %newlineLOGGER: %logger %newline%newline%message"/>
    </layout>

It works fine.


Now, I would like to use Pattern names in message variable.

For example, I'm trying to do:

string msg = "The time is %date and the logger is %logger";
myLogger.Info(msg);

And of course, it doesn't work.
The output is: The time is %date and the logger is %logger.

Any idea to achieve that?

Thx a lot

Pascal

Gmane