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:

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

        <channel ref="tcp" port="42024" />
        <wellknown mode="Singleton"
type="StainRemovalAnalysis.Analysis, StainRemovalAnalysis"
objectUri="ImageAnalysis" />

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

    <appender name="SRAFileAppender"
      <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" />
    <appender name="DebugConsoleOutput" type="log4net.Appender.TraceAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %message%newline" />
      <level value="ALL" />
      <appender-ref ref="DebugConsoleOutput"/>
      <appender-ref ref="SRAFileAppender"/>

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 =

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=, Culture=neutral,
PublicKeyToken=1b44e1d426115821]. Loaded from
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: DefaultRepositorySelector: Creating repository for assembly
[StainRemovalAnalysis, Version=, Culture=neutral,
log4net: DefaultRepositorySelector: Assembly [StainRemovalAnalysis,
Version=, Culture=neutral, PublicKeyToken=null] Loaded From
log4net: DefaultRepositorySelector: Assembly [StainRemovalAnalysis,
Version=, Culture=neutral, PublicKeyToken=null] does not have a
RepositoryAttribute specified.
log4net: DefaultRepositorySelector: Assembly [StainRemovalAnalysis,
Version=, Culture=neutral, PublicKeyToken=null] using
repository [log4net-default-repository] and repository type
log4net: DefaultRepositorySelector: Creating repository
[log4net-default-repository] using type
log4net: Hierarchy: Shutdown called on Hierarchy [log4net-default-repository]
View raw message