If your file has suffix .config, you must use configuration section
handler. See log4net doc and bellow:
<configuration>
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
</log4net>
---------
Prostredi: C#, WinForms, VS2008 Pro, Vista business, CoreDuo, 4GB RAM
___________________________________________________
Karel Kral, senior developer
ANETE, s.r.o.
___________________________________________________
Dne 23.4.2008 14:48, aus1977 napsal(a):
> I need to move log4net configuration from app.config file and i have tryed
> the following :
>
> app.config file :
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <appSettings>
> <add key="Log4NetConfiguration" value="log4net.config" />
> </appSettings>
> </configuration>
>
> log4net.config file:
> <log4net>
>
> <appender name="Framework.Manager"
> type="log4net.Appender.RollingFileAppender">
> <file value="Logs\Gogimon.Framework.Manager.log.txt" />
> <appendToFile value="true" />
> <rollingStyle value="Size" />
> <maxSizeRollBackups value="1" />
> <maximumFileSize value="500KB" />
> <staticLogFileName value="true" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%date %newline[%thread] %-5level %logger
> [%ndc] <%property{auth}> - %message%newline%newline" />
> </layout>
> </appender>
>
> <logger name="Framework.Manager" additivity="false">
> <level value="ALL" />
> <appender-ref ref="Gogimon.Framework.Manager" />
> </logger>
> <log4net>
>
> it is doesn't works
>
|