Yes, you can.
I'm using log4net in large Compact Framework 2.0 project and it works great.
Sample configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<log4net debug="false">
<appendername="RollingLogFileAppender"type="log4net.Appender.RollingFileAppender">
<file value="\Application\AgileroLog.txt" />
<appendToFile value="true" />
<maxSizeRollBackups value="2" />
<maximumFileSize value="1048576" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%newline Date: %date ,Application: %a ,Logger: %logger ,Thread: [%thread] ,Level: %level %newline Message: %message%newline Exception: %exception%newline" />
</layout>
</appender>
<!-- Setup the root category, add the appenders and set the default level -->
<root>
<level value="INFO" />
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
</configuration>
File name: application.exe.config or specified in code:
log4net.Config.XmlConfigurator.Configure(new FileInfo(configPath));
Best Regards
Darek