You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Wagner, Wolfgang (LfF-R)" <Wo...@lff.bayern.de> on 2005/11/22 09:41:22 UTC
web.config problem
hi all!
i have a problem configuring the log4net rollingfileappender. my
application is structured as followed:
web_root
+-application main
+-bin
+-main
+- log.txt
+- ..... (all the other files)
Web.config
here is my Web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="RollingFile"
type="log4net.Appender.RollingFileAppender">
<param name="File" value="main\log.txt" />
<param name="AppendToFile" value="true" />
<param name="MaxSizeRollBackups" value="5" />
<param name="MaximumFileSize" value="100KB" />
<param name="RollingStyle" value="Size" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern"
value="%date %level - %message%newline" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="RollingFile" />
</root>
</log4net>
<appSettings>
....
</configuration>
the problem ist that the log.txt has 0 bytes, even if i try to log into
it. but the application runs perfect (except the logging).
does anyone know whats the problem??
greets
wolfgang
Re: web.config problem
Posted by Matthew Brown <oc...@gmail.com>.
Wolfgang,
Do you have a call to XmlConfigurator?
On 11/22/05, Wagner, Wolfgang (LfF-R) <Wo...@lff.bayern.de> wrote:
>
> hi all!
>
> i have a problem configuring the log4net rollingfileappender. my
> application is structured as followed:
> web_root
> +-application main
> +-bin
> +-main
> +- log.txt
> +- ..... (all the other files)
> Web.config
>
> here is my Web.config:
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>
> <configSections>
> <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
> </configSections>
>
> <log4net>
> <appender name="RollingFile"
> type="log4net.Appender.RollingFileAppender">
> <param name="File" value="main\log.txt" />
> <param name="AppendToFile" value="true" />
> <param name="MaxSizeRollBackups" value="5" />
> <param name="MaximumFileSize" value="100KB" />
> <param name="RollingStyle" value="Size" />
> <param name="StaticLogFileName" value="true" />
> <layout type="log4net.Layout.PatternLayout">
> <param name="ConversionPattern"
> value="%date %level - %message%newline" />
> </layout>
> </appender>
>
> <root>
> <level value="INFO" />
> <appender-ref ref="RollingFile" />
> </root>
> </log4net>
>
> <appSettings>
> ....
> </configuration>
>
> the problem ist that the log.txt has 0 bytes, even if i try to log into
> it. but the application runs perfect (except the logging).
> does anyone know whats the problem??
>
> greets
> wolfgang
>