Hi, everyone,
in the DNN6, there is DotNetNuke.Log4Net.dll in the Bin folder
and there is config file: DotNetNuke.log4net.config, the content of this file as below:
----------------------
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="Portals/_default/Logs/" />
<datePattern value="yyyy.MM.dd'.log.resources'" />
<rollingStyle value="Date" />
<staticLogFileName value="false" />
<appendToFile value="true" />
<maximumFileSize value="10MB" />
<maxSizeRollBackups value="5" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%property{log4net:HostName}][Thread:%thread][%level] %logger - %message%newline" />
<locationInfo value="true" />
</layout>
</appender>
<appender name="nHibernateAppender" type="log4net.Appender.RollingFileAppender">
<file value="Portals/_default/Logs/system.log"/>
<appendToFile value="true"/>
<rollingStyle value="Size"/>
<param name="DatePattern" value="dd/MM/yyyy"/>
<maxSizeRollBackups value="10"/>
<maximumFileSize value="10MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
</layout>
</appender>
<appender name="nHibernateAppender.SQL" type="log4net.Appender.RollingFileAppender">
<file value="Portals/_default/Logs/system.sql.log"/>
<appendToFile value="true"/>
<rollingStyle value="Size"/>
<maxSizeRollBackups value="10"/>
<maximumFileSize value="10MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
</layout>
</appender>
<logger name="NHibernate">
<level value="WARN"/>
<appender-ref ref="nHibernateAppender"/>
</logger>
<logger name="NHibernate.SQL">
<level value="ALL"/>
<priority value="DEBUG"/>
<appender-ref ref="nHibernateAppender.SQL"/>
</logger>
<root>
<level value="ERROR"/>
<appender-ref ref="RollingFile"/>
</root>
</log4net>
-------------------------------
in my custom module, i have added code:
log4net.Config.XmlConfigurator.Configure(new FileInfo(Server.MapPath("/DotNetNuke.log4net.config")));
in method "Page_Init".
and i have added :
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
in my DAL.dll
but there is no sql was generated into log file.
where was wrong?
any idea will be appreciated. Thank you