You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Mat Arge (JIRA)" <ji...@apache.org> on 2014/01/28 12:42:37 UTC
[jira] [Updated] (LOG4NET-420) Destructor of class called upon
invoking XmlConfigurator.Configure
[ https://issues.apache.org/jira/browse/LOG4NET-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mat Arge updated LOG4NET-420:
-----------------------------
Description:
If I run XmlConfigurator.Configure on an XML File after an instance of some class has been created, the destructor of that class is called for some reason. Here is my test code:
{code:C#}
using System;
public class Test
{
~Test()
{
Console.WriteLine("Test object finalized.");
}
}
public static class M
{
public static void Main()
{
Console.WriteLine("Start");
Test test = new Test();
Console.WriteLine("configuring");
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("LogConfiguration.xml"));
Console.WriteLine("End");
}
}
{code:C#}
Running this yields the output:
{quote}
Start
configuring
Test object finalized.
End
{quote}
I'm not really sure, if this is a bug in log4net or in mono
was:
If I run XmlConfigurator.Configure on an XML File after an instance of some class has been created, the destructor of that class is called for some reason. Here is my test code:
using System;
public class Test
{
~Test()
{
Console.WriteLine("Test object finalized.");
}
}
public static class M
{
public static void Main()
{
Console.WriteLine("Start");
Test test = new Test();
Console.WriteLine("configuring");
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("LogConfiguration.xml"));
Console.WriteLine("End");
}
}
Running this yields the output:
Start
configuring
Test object finalized.
End
I'm not really sure, if this is a bug in log4net or in mono
> Destructor of class called upon invoking XmlConfigurator.Configure
> ------------------------------------------------------------------
>
> Key: LOG4NET-420
> URL: https://issues.apache.org/jira/browse/LOG4NET-420
> Project: Log4net
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.10, 1.2.13
> Environment: Linux (openSuse 12.2 i586), Mono 2.10.9
> Reporter: Mat Arge
>
> If I run XmlConfigurator.Configure on an XML File after an instance of some class has been created, the destructor of that class is called for some reason. Here is my test code:
> {code:C#}
> using System;
>
> public class Test
> {
> ~Test()
> {
> Console.WriteLine("Test object finalized.");
> }
> }
> public static class M
> {
> public static void Main()
> {
> Console.WriteLine("Start");
> Test test = new Test();
> Console.WriteLine("configuring");
> log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("LogConfiguration.xml"));
> Console.WriteLine("End");
> }
> }
> {code:C#}
> Running this yields the output:
> {quote}
> Start
> configuring
> Test object finalized.
> End
> {quote}
> I'm not really sure, if this is a bug in log4net or in mono
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)