Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log file is not created when using log4Net logger #7

Open
GoogleCodeExporter opened this issue Mar 31, 2015 · 2 comments
Open

Log file is not created when using log4Net logger #7

GoogleCodeExporter opened this issue Mar 31, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 10 Aug 2010 at 3:41

@GoogleCodeExporter
Copy link
Author

Any update on this.I am also getting same issue.

Original comment by [email protected] on 8 Jun 2012 at 3:37

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 23 Jun 2014 at 9:18

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant