For what it's worth to you, here is what I have and it's working fine:

AssemblyInfo.cs:

[assembly: log4net.Config.DOMConfigurator(Watch=true)]

Web.config (log.txt is created in the base project directory):

 <!-- Register a section handler for the log4net section -->
 <configSections>
  <section name="log4net" 
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
 </configSections>

 <!-- This section contains the log4net configuration settings -->
 <log4net>
  <!-- Define some output appenders -->
  <appender name="RollingLogFileAppender" 
type="log4net.Appender.RollingFileAppender">
   <param name="File" value="log.txt" />
   <param name="AppendToFile" value="true" />
   <param name="MaxSizeRollBackups" value="2" />
   <param name="MaximumFileSize" value="200KB" />
   <param name="RollingStyle" value="Size" />
   <param name="StaticLogFileName" value="true" />
   <layout type="log4net.Layout.PatternLayout">
    <param name="Header" value="[Header]\r\n" />
    <param name="Footer" value="[Footer]\r\n" />
    <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
   </layout>
  </appender>
  <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
   <layout type="log4net.Layout.PatternLayout">
    <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] 
&lt;%X{auth}&gt; - %m%n" />
   </layout>
  </appender>

  <root>
   <level value="INFO" />
   <appender-ref ref="RollingLogFileAppender" />
  </root>

  <logger 
name="IBatisNet.DataMapper.Configuration.Statements.DefaultPreparedCommand">
   <level value="ALL" />
  </logger>
 </log4net>




>  -------Original Message-------
>  From: Ling Wang <[EMAIL PROTECTED]>
>  Subject: Debug SQL Statement, Log4net help needed
>  Sent: 12 Sep '05 09:43
>  
>  Hi there,
>  
>  I ran NPetShop out of box and got an sql exception
>  "Data type mismatch in criteria" when I tried to
>  register a new user (I did not create any new code,
>  the original code uses "InsertProfile"). I would like
>  to see the sql statement. I searched the mail archive
>  and found a suggestion using
>  GetMappedStatement("InsertProfile"). I tried and got
>  an message:
>  
>  MappedStatement: InsertProfile
>  InsertProfile-InLineParameterMap
>  
>  which is not I am looking for.
>  
>  I then tried to configure log4net following the
>  documentation. Hoping to get the SQL statement that
>  way. I tried almost everything including adding
>  log4net config info to  the web.config or using its
>  own config file by setting or withoug setting:
>  
>  [assembly: log4net.Config.DOMConfigurator(
>  ConfigFile="NPetshop.Web.dll.config",Watch=true )]
>  
>  I still did not see any log.txt file.
>  
>  Can anyone help me out?
>  
>  Thanks.
>  
>  Ling
>  

Reply via email to