logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karel Kral <kral.k...@volny.cz>
Subject Detached definition of layout
Date Tue, 14 Nov 2006 08:28:43 GMT
Hello, my log4net config gets to be a bit complicated. I have lot of
appenders, which of them defines the same layout:

      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %-35.35logger
[%-10.10property{NDC}] - %message%newline" />
      </layout>

When I must to change definition of layout, the multiple definition of
the same layout is problem - I must change the same thing on several places.

Is there any possibility to define "detached" layout in log4net config
and in appender only set reference to it?

Example:
<layout name="MySharedLayout", type="log4net.Layout.PatternLayout">
   <conversionPattern value="%date [%thread] %-5level %-35.35logger
[%-10.10property{NDC}] - %message%newline" />
 </layout>

<appender name="Global.FileAppender"
yype="log4net.Appender.RollingFileAppender">
...
<layout-ref ref="MySharedLayout">
    </appender>


-- 
___________________________________________________
Karel Kral, vyvojar
ANETE, s.r.o.
Prostredi: VB.NET, VS2005, XP Pro/P4 3GHz, 2GB RAM
___________________________________________________

Mime
View raw message