You're right. I obviously had no idea what the root logger did or that it even existed. Now that you point it out and I know what to search for in the doc, it is pretty clear.
Thanks for the help. Dan Essin On Tue, 5 Dec 2006 13:40:50 -0500, "Peter Drier" <[EMAIL PROTECTED]> said: > It looks like you have both your <root> logger and your <logger > name="errorlog"> set to go to the LogFileAppender.. > > Try taking the _____<appender-ref ref="LogFileAppender" />_____ line out > of > one of them, and the duplication should go away. > > -Peter > > > On 12/5/06, Daniel Essin <[EMAIL PROTECTED]> wrote: > > > > The config follows: > > I've comment out the console appender and this is the output: > > ------------------ > > 2006-12-05 10:31:03,812 [2980] INFO errorlog - Application Started > > 2006-12-05 10:31:03,812 [2980] INFO errorlog - Application Started > > 2006-12-05 10:31:08,015 [2980] ERROR errorlog - The configuration file has > > been changed by another program. (E:\ORnet Release > > 2.10\ORnetSourceSoce\bin\Debug\ORnet.exe.Config) > > 2006-12-05 10:31:08,015 [2980] ERROR errorlog - The configuration file has > > been changed by another program. (E:\ORnet Release > > 2.10\ORnetSourceSoce\bin\Debug\ORnet.exe.Config) > > 2006-12-05 10:31:11,203 [2980] INFO errorlog - Application Ended > > 2006-12-05 10:31:11,203 [2980] INFO errorlog - Application Ended > > > > Config File: > > ----------------- > > <?xml version="1.0" encoding="utf-8"?> > > <configuration> > > <configSections> > > <section name="log4net" type=" > > log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> > > <sectionGroup name="Databases" type=" > > System.Configuration.ConfigurationSectionGroup, System.Configuration, > > Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> > > <section name="DB2OrNetProvider" type=" > > ProjectStructure.DatabaseConfigurationSection, CustomConfigClassLibrary, > > Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" > > allowLocation="true" allowDefinition="Everywhere" > > allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" > > requirePermission="true" /> > > <section name="GenericOleDbOrNetProvider" type=" > > ProjectStructure.DatabaseConfigurationSection, CustomConfigClassLibrary, > > Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" > > allowLocation="true" allowDefinition="Everywhere" > > allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" > > requirePermission="true" /> > > <section name="OracleOrNetProvider" type=" > > ProjectStructure.DatabaseConfigurationSection, CustomConfigClassLibrary, > > Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" > > allowLocation="true" allowDefinition="Everywhere" > > allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" > > requirePermission="true" /> > > <section name="SqlServerOrNetProvider" type=" > > ProjectStructure.DatabaseConfigurationSection, CustomConfigClassLibrary, > > Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" > > allowLocation="true" allowDefinition="Everywhere" > > allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" > > requirePermission="true" /> > > </sectionGroup> > > </configSections> > > <appSettings> > > <add key="log4net.Internal.Debug" value="false" /> > > <add key="LastUsedProviderName" value="SqlServerOrNetProvider" /> > > </appSettings> > > <log4net> > > <appender name="LogFileAppender" type="log4net.Appender.FileAppender"> > > <file value="log-file.txt" /> > > <appendToFile value="false" /> > > <layout type="log4net.Layout.PatternLayout"> > > <header value="" /> > > <footer value="" /> > > <conversionPattern value="%date [%thread] %-5level %logger - > > %message%newline" /> > > </layout> > > </appender> > > <!-- <appender name="ConsoleAppender" type=" > > log4net.Appender.ConsoleAppender">--> > > <!-- <layout type="log4net.Layout.PatternLayout">--> > > <!-- <conversionPattern value="%date [%thread] %-5level %logger > > - %message%newline" />--> > > <!-- </layout>--> > > <!-- </appender>--> > > <root> > > <level value="INFO" /> > > <appender-ref ref="LogFileAppender" /> > > <!-- <appender-ref ref="ConsoleAppender" />--> > > </root> > > <!-- Specify the level for some specific categories --> > > <logger name="errorlog"> > > <level value="ALL" /> > > <appender-ref ref="LogFileAppender" /> > > </logger> > > </log4net> > > <Databases> > > <DB2OrNetProvider SectionName="DB2OrNetProvider" LastUsed="false" > > DatabaseName="" Server="" Username="" Schema="" Password="" > > IntegratedSecurity="false" PersistSecurityInfo="false" > > ConnectStringMode="false" CustomConnectString="" > > Provider="SqlServerOrNetProvider" OleDbProvider="" DbTreeName="" /> > > <GenericOleDbOrNetProvider SectionName="GenericOleDbOrNetProvider" > > LastUsed="false" DatabaseName="" Server="" Username="" Schema="" Password="" > > IntegratedSecurity="false" PersistSecurityInfo="false" > > ConnectStringMode="false" CustomConnectString="" > > Provider="SqlServerOrNetProvider" OleDbProvider="" DbTreeName="" /> > > <OracleOrNetProvider SectionName="OracleOrNetProvider" > > LastUsed="false" DatabaseName="" Server="" Username="" Schema="" Password="" > > IntegratedSecurity="false" PersistSecurityInfo="false" > > ConnectStringMode="false" CustomConnectString="" > > Provider="SqlServerOrNetProvider" OleDbProvider="" DbTreeName="" /> > > <SqlServerOrNetProvider SectionName="SqlServerOrNetProvider" > > LastUsed="false" DatabaseName="Northwind" Server="WPC64" Username="" > > Schema="" Password="" IntegratedSecurity="true" PersistSecurityInfo="false" > > ConnectStringMode="false" CustomConnectString="Server=WPC64;Initial > > Catalog=Northwind;Integrated Security=True;Persist Security Info=False;" > > Provider="SqlServerOrNetProvider" OleDbProvider="" DbTreeName="" /> > > </Databases> > > </configuration> > > > > Thanks, > > Dan > > > > > > Karel Kral wrote: > > > > I also encountered this when I have duplicate appender references. Post > > your config. > > ___________________________________________________ > > Karel Kral, vyvojar > > ANETE, s.r.o. > > Prostredi: VB.NET, VS2005, XP Pro/P4 3GHz, 2GB RAM > > ___________________________________________________ > > > > On 5.12.2006 5:45, Ron Grabowski wrote: > > > > Posting your configuration would be helpful. > > > > > > ----- Original Message ---- > > > > From: Daniel Essin <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> > > > > To: [email protected] > > > > Sent: Monday, December 4, 2006 9:23:07 PM > > > > Subject: Startup-Shutdown Error? > > > > > > > > I've git the following code in the main form for a project: > > > > [NonSerialized] > > > > protected static readonly ILog log = > > LogManager.GetLogger("errorlog"); > > > > public MasterProject() { > > > > > > > > InitializeComponent(); > > > > log.Info("Application Started"); > > > > } > > > > private void MasterProject_FormClosed(object sender, > > FormClosedEventArgs e) > > > > { > > > > log.Info("Application Ended"); > > > > } > > > > > > > > > > > > This is the log: > > > > 2006-12-04 18:21:27,508 [860] INFO errorlog - Application Started > > > > 2006-12-04 18:21:27,508 [860] INFO errorlog - Application Started > > > > 2006-12-04 18:21:29,883 [860] INFO errorlog - Application Ended > > > > 2006-12-04 18:21:29,883 [860] INFO errorlog - Application Ended > > > > > > > > Why are the entries duplicated? I have stepped this in the debugger and > > each call is only executed once. > > > > > > > > Thank you, > > > > de > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
