I have 2 console apps projects in the same directory but different projects. There is some common code in the App_Code directory and a common app.config which gets build into seperate .exe.config files.
One module (VScanDemonStarter) starts up and writes to one logger with its own appender going to a seperate file. It uses an process.start() to execute the other module (VScanDemon) in another command prompt hidden window.
When I run VScanDemon by itself it puts entries into its log file. When I run VScanDemonStarter it puts entries into its (different) log file, the VScanDemon log file gets created, but no entries. I can see it is executing because some files get moved from one directory to another. Just no Log entries.
the config looks like
<root>
<level value="INFO" />
</root>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="log/vscandemonstarter.log" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p %d{yyyy-MM-dd hh:mm:ss} - %m%n" />
</layout>
</appender>
<appender name="vsdemonlogfileappender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="log/vscandemon.log" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p %d{yyyy-MM-dd hh:mm:ss} - %m%n" />
</layout>
</appender>
and the code bodies set up and call the bodies with.
VScanDemonStarter:
top of module:
Private ReadOnly log As ILog = log4net.LogManager.GetLogger("default")
top of main:
log4net.Config.XmlConfigurator.Configure()
example calls:
If log.IsInfoEnabled Then log.Info("VScanDemonStarter:Main: ----called----")
VBScanDemon:
top of module:
Private ReadOnly log As ILog = log4net.LogManager.GetLogger("VSDemonLogger")
top of main:
log4net.Config.XmlConfigurator.Configure()
VBScanDemon:
If log.IsInfoEnabled Then log.Info("VScanDemon:Main: ----called----")
I don't get any log entries from VScanDemon. Anybody with ideas about the cause or fix.
Thanks,
---John Putnam