logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skifreak <skifreak...@gmail.com>
Subject Newbie - can't get anything to show in the log
Date Mon, 17 Dec 2012 13:48:41 GMT
This is a console C# 4.0 application

app.config:
 <log4net>
    <appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
      <file type="log4net.Util.PatternString" value="F:\logs\CPDMonitor"/>
      <appendToFile value="true"/>
      <rollingStyle value="Date"/>
      <datePattern value="_yyyyMMdd_hh_mm_ss_sss'.log'"/>
      <maximumFileSize value="20MB"/>
      <staticLogFileName value="false"/>
      <maxSizeRollBackups value="20"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger -
%message%newline"/>
      </layout>
    </appender>
    <logger name="RollingLogFileAppender">
      <level value="DEBUG" />
      <appender-ref ref="RollingLogFileAppender" />
    </logger>
  </log4net> 

In main I did:
XmlConfigurator.Configure();            
log = LogManager.GetLogger(typeof(Program));

To add an entry I used:
log.DebugFormat("Sending eMail " + DateTime.Now.ToString("yyyyMMdd
hh:mm:ss") + " with " + alList.Count.ToString() + " records.");

It will create the log but I get no error on the above log.DebugFormat line

Thanks for any help in advance,
Mark




--
View this message in context: http://apache-logging.6191.n7.nabble.com/Newbie-can-t-get-anything-to-show-in-the-log-tp35190.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.

Mime
View raw message