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 Orçun DAYIBAS <od...@aselsan.com.tr> on 2007/05/16 10:48:18 UTC
RollingFileAppender cannot create file in .NET CF
Hi all,
I have a problem with logging section of my compact framework application. First things first; my environment involves: log4net 1.2.10, .net compact framework 2.0 SP2, windows mobile 5.0 and assembly type is DLL. I'm using rolling file appender with internal debugging but either this debugging output(log4net.txt) nor logging file(log.txt) hasn't been created on device. On the other hand, log file is created on emulator without any problem with same configuration.
Here is the concerning configuration file (LogBusinessManager.cfg):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="\log4net.txt" />
</listeners>
</trace>
</system.diagnostics>
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date] [%level] [%message]%newline" />
</layout>
<file value="log.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="50KB" />
<staticLogFileName value="true" />
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
</root>
</log4net>
</configuration>
Here is the initilazation code snippet:
...
XmlConfigurator.Configure(new FileInfo(@"\LogBusinessManager.cfg"));
logger = log4net.LogManager.GetLogger(typeof(BMLog));
...
I've tried to put writable log.txt file the directory, but file has not been appended with any statement. Thanks for posibble incoming helps...
######################################################################
Dikkat:
Bu elektronik posta mesaji kisisel ve ozeldir. Eger size
gonderilmediyse lutfen gondericiyi bilgilendirip mesaji siliniz.
Firmamiza gelen ve giden mesajlar virus taramasindan gecirilmekte,
guvenlik nedeni ile kontrol edilerek saklanmaktadir. Mesajdaki
gorusler ve bakis acisi gondericiye ait olup Aselsan A.S. resmi
gorusu olmak zorunda degildir.
######################################################################
Attention:
This e-mail message is privileged and confidential. If you are
not the intended recipient please delete the message and notify
the sender. E-mails to and from the company are monitored for
operational reasons and in accordance with lawful business practices.
Any views or opinions presented are solely those of the author and
do not necessarily represent the views of the company.
######################################################################