logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alvarez Alvarez, Victor Manuel" <vmalva...@umh.es>
Subject RollingLogFileAppender and custom remote File
Date Thu, 10 Sep 2009 13:01:37 GMT

I have the next scenario, and I don't know how to do it.


I need to use RollingLogFileAppender but the param name path file have to change in different
environments. I would like the web.config file to be the same in 3 environments (TEST, PRE-PRODUCTION
and PRODUCTION) and always write in the same remote server, but in different folder


<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">

      <param name="File" value="\\RemoteLogServer\TEST\app1\logs\currentlog.config"/>

      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

      <appendToFile value="true"/>

      <rollingStyle value="Date"/>

      <datePattern value="ddMMyyyy"/>

      <maxSizeRollBackups value="5"/>

      <maximumFileSize value="1MB"/>

      <filter type="log4net.Filter.LevelRangeFilter">

        <acceptOnMatch value="true"/>

        <levelMin value="DEBUG"/>

        <levelMax value="FATAL"/>


      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="%-5p %d %5rms - %m%n"/>




In PRO will be 

<param name="File" value="\\RemoteLogServer\PRO\app1\logs\currentlog.config"/>



┬┐How can I configure this line for not to change when I deploy it?, with any pattern or anything

For instance

<param name="File" value="\\RemoteLogServer\[%ENV%]\app1\logs\currentlog.config"/>



Best regards.



View raw message