logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Carleton" <scarle...@miltonstreet.com>
Subject no log file is being created, I am stumped
Date Tue, 03 Jul 2007 21:43:00 GMT
This seems to happen EVERY time I use log4net in a new program.  I
take the app.config from an existing project, change the appender name
and the name of the log file and NOTHING happens!  I don't get a log
file!  Once I get it going, it works GREAT and I love it, it is just
the getting it working!  And at 5:30pm on the 3rd of July, I hate
going home with code that doesn't work, but oh well…

Ok, I will stop venting and give some useful info incase someone
knows the answer.  Here is my app.config file, I cut/paste the
configSections and the log4net elements and their contents from
another project that IS working:

  <configSections>
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
  </configSections>

  <system.runtime.remoting>
    <application>
      <channels>
        <channel ref="tcp" port="42024" />
      </channels>
      <service>
        <wellknown mode="Singleton"
type="StainRemovalAnalysis.Analysis, StainRemovalAnalysis"
objectUri="ImageAnalysis" />
      </service>
    </application>
  </system.runtime.remoting>

  <appSettings>
    <add key="log4net.Internal.Debug" value="true"/>
  </appSettings>

  <log4net>
    <appender name="SRAFileAppender"
type="log4net.Appender.RollingFileAppender">
      <file value="SRA.log" />
      <appendToFile value="false" />
      <maxSizeRollBackups value="10" />
      <rollingStyle value="Once" />
      <staticLogFileName value="false" />
      <layout type="log4net.Layout.PatternLayout">
        <header value="[Header]&#13;&#10;" />
        <footer value="[Footer]&#13;&#10;" />
        <conversionPattern value="%date [%thread] %-5level %logger
[%ndc] - %message%newline" />
      </layout>
    </appender>
    <appender name="DebugConsoleOutput" type="log4net.Appender.TraceAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="DebugConsoleOutput"/>
      <appender-ref ref="SRAFileAppender"/>
    </root>
  </log4net>

The ONLY different between the two projects is that the working one is
C#.Net 2.0 and this is VB.Net 2.0.

I have this in the modMain, which is the startup module for the VB.Net program:

Private ReadOnly log As log4net.ILog =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)

The very first line of the program is:

log.Info("Starting Analysis")

I did turn on the log4net debug logging and this is the result:

log4net: log4net assembly [log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=1b44e1d426115821]. Loaded from
[C:\development\MarksProj\Stain
Removal\StainRemovalAnalysis\bin\Debug\log4net.dll]. (.NET Runtime
[2.0.50727.42] on Microsoft Windows NT 5.1.2600 Service Pack 2)
log4net: DefaultRepositorySelector: defaultRepositoryType
[log4net.Repository.Hierarchy.Hierarchy]
log4net: DefaultRepositorySelector: Creating repository for assembly
[StainRemovalAnalysis, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null]
log4net: DefaultRepositorySelector: Assembly [StainRemovalAnalysis,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From
[C:\development\MarksProj\Stain
Removal\StainRemovalAnalysis\bin\Debug\StainRemovalAnalysis.exe]
log4net: DefaultRepositorySelector: Assembly [StainRemovalAnalysis,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a
RepositoryAttribute specified.
log4net: DefaultRepositorySelector: Assembly [StainRemovalAnalysis,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using
repository [log4net-default-repository] and repository type
[log4net.Repository.Hierarchy.Hierarchy]
log4net: DefaultRepositorySelector: Creating repository
[log4net-default-repository] using type
[log4net.Repository.Hierarchy.Hierarchy]
log4net: Hierarchy: Shutdown called on Hierarchy [log4net-default-repository]
Mime
View raw message