logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From El Tigre <el_tigre...@yahoo.com>
Subject Re: Log4net NOT working on .net 4.5
Date Wed, 10 Apr 2013 07:03:50 GMT
Some code:
using log4net;
using log4net.Config;
public partial class Login 
    {
       
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Login));
        UserServices usrsrv = new UserServices();
    }

 private void Form1_Load(object sender, EventArgs e)
        {
           log.Info("Start program");
            this.CenterToScreen();
}

APP.CONFIG

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468
-->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,
EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,
log4net"/>
  </configSections>
  <log4net>
    <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="logAdminRetele.txt"/>
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
      <appendToFile value="true"/>
      <rollingStyle value="Size"/>
      <maxSizeRollBackups value="2"/>
      <maximumFileSize value="10MB"/>
      <staticLogFileName value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%-5p%d{dd-MM-yyyy HH:mm:ss} – %m%n"/>
      </layout>
    </appender>
    <root>
      <level value="ALL"/>
      <appender-ref ref="LogFileAppender"/>
    </root>
  </log4net>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory,
EntityFramework">
      <parameters>
        <parameter value="v11.0"/>
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
  <connectionStrings>
    <add name="networkingEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider
connection string=&quot;server=localhost;user id=root;password=lucian;persist security
info=True;database=networking&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>
</configuration>

And the version installed is 1.2.1.1 (latest) 
Mime
View raw message