lihoumin / mybatisnet

Automatically exported from code.google.com/p/mybatisnet
0 stars 0 forks source link

Log file is not created when using log4Net logger #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the MyBatis.NET are you using?
ibatis.datamapper.1.6.2. 
VS 2008

Please describe the problem.  Unit tests are best!
Iam new to Ibatis....
Log file is not created at all after trying all the tricks...what am i doing 
wrong?

assemble.info file is in properties folder
web.config,log4net.config: in main project folder

Assembly.info file has:
[assembly: log4net.Config.XmlConfiguratorAttribute(ConfigFile = 
"log4net.config", Watch = true)]

Web.config file
<sectionGroup name="iBATIS">
            <section name="logging"
            type="IBatisNet.Common.Logging.ConfigurationSectionHandler, 
        IBatisNet.Common" />
</sectionGroup>
<iBATIS>
    <logging>
            <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, 
  IBatisNet.Common.Logging.Log4Net">
                <arg key="configType" value="FILE-WATCH" />
                <arg key="configFile" value="log4net.config" />
            </logFactoryAdapter>
    </logging>
</iBATIS>

finally log4net.config has
<configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    </configSections>

<appender name="RollingLogFileAppender"
        type="log4net.Appender.RollingFileAppender">
            <file value="Estatlog.txt" />
            <appendToFile value="true" />
            <maximumFileSize value="5MB" />
            <maxSizeRollBackups value="-1" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%5level [%date] %-40.40logger{2} 
%message%newline" />
            </layout>
        </appender>
<root>
            <level value="ERROR" />
            <appender-ref ref="RollingLogFileAppender" />
            <appender-ref ref="ConsoleAppender" />
        </root>

        <!-- Print only messages of level DEBUG or above in the packages -->
        <logger name="IBatisNet.DataMapper.Commands.DefaultPreparedCommand">
            <level value="ALL" />
        </logger>
        <logger name="IBatisNet.DataMapper.Configuration.Cache.CacheModel">
            <level value="ALL" />
        </logger>

What is the expected output? What do you see instead?
a Estatlog.txt log file created in the project folder

Please provide any additional information below.

y

Original issue reported on code.google.com by panch...@gmail.com on 10 Aug 2010 at 3:41

GoogleCodeExporter commented 8 years ago
Any update on this.I am also getting same issue.

Original comment by jatintri...@gmail.com on 8 Jun 2012 at 3:37

GoogleCodeExporter commented 8 years ago
I experienced the same problem.
andI was so resolved.
log4net.dll down grade.
log4net 1.2.13.0 > log4net 1.2.10.0 

Original comment by nclov...@gmail.com on 23 Jun 2014 at 9:18