Appender Close() not being called when application ends

2009-02-06 Thread Michael Mayne
Hi,

I'm creating a custom AsyncAppender() that buffers synchronous event appends
, using an internal dequeue thread to process these buffered events sending
them onto attached appenders. The internal workings are not important to my
problem (I think)... 

 

What I'm seeing is that neither the Close() or ~AsyncAppender() (finalize)
methods are being called when my test program attempts to exit i.e. my test
program hangs. This is important because my class cleanup triggers the
dequeue thread to drain any buffered events, terminate the thread and
dispose. If not triggered the dequeue thread sits there waiting on an
autoReset event for ever - hence the program hang.

 

However, If I explicitly shutdown the repository, Close() is called and it
all works perfectly.

 

logger.Logger.Repository.Shutdown();

 

AsyncAppender inherits AppenderSkeleton so overrides OnClose(). It also
implements IDisposable using the classic Dispose pattern.

My test program is configuring everything programmatically (no config files)
so I can see what's going on - well that was the idea J

 

I would have thought that when my program exited, Log4net would be garbage
collected and my Close() (or destructor) method would be called.

 

What am I doing wrong?

 

I can include some code later but I really want to get an idea of the
appender lifecycle.

Thanks

Michael

 

 



[jira] Created: (LOG4NET-197) Download of 1.2.10 fails at 4.8M and zip does not open - therefore can't use s/w

2009-02-06 Thread James Stewart (JIRA)
Download of 1.2.10 fails at 4.8M and zip does not open - therefore can't use s/w


 Key: LOG4NET-197
 URL: https://issues.apache.org/jira/browse/LOG4NET-197
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.10
 Environment: IE7, Firefox, Vista
Reporter: James Stewart


Simply, the download from http://logging.apache.org/log4net/download.html is 
not working; the d/load fails at about 4.8M and so I can't use the s/w in any 
way. I also do not get a list of mirrors as suggested and can't find anywhere 
else to download from. Help!
Apologies if this is not teh right place to report this, but it is a bit of a 
"Blocker"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (LOG4NET-197) Download of 1.2.10 fails at 4.8M and zip does not open - therefore can't use s/w

2009-02-06 Thread Ron Grabowski (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671114#action_12671114
 ] 

Ron Grabowski commented on LOG4NET-197:
---

I tried it just now and was able to download ok. This issue comes up every now 
and then. I think one of the Apache mirrors has a bad file?

> Download of 1.2.10 fails at 4.8M and zip does not open - therefore can't use 
> s/w
> 
>
> Key: LOG4NET-197
> URL: https://issues.apache.org/jira/browse/LOG4NET-197
> Project: Log4net
>  Issue Type: Task
>  Components: Core
>Affects Versions: 1.2.10
> Environment: IE7, Firefox, Vista
>Reporter: James Stewart
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Simply, the download from http://logging.apache.org/log4net/download.html is 
> not working; the d/load fails at about 4.8M and so I can't use the s/w in any 
> way. I also do not get a list of mirrors as suggested and can't find anywhere 
> else to download from. Help!
> Apologies if this is not teh right place to report this, but it is a bit of a 
> "Blocker"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (LOG4NET-198) Memory leak on a very basic code

2009-02-06 Thread rauzy (JIRA)
Memory leak on a very basic code


 Key: LOG4NET-198
 URL: https://issues.apache.org/jira/browse/LOG4NET-198
 Project: Log4net
  Issue Type: Test
  Components: Core
Affects Versions: 1.2.10
 Environment: windows xp sp3
Reporter: rauzy


I build a simple form with a single button that start a timer execute every 
second, the task of this timer is to execute the following line:

log.Debug("Hello");

and I observe a memory leak.

See Below.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using log4net;
using log4net.Config;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private static readonly ILog log = LogManager.GetLogger(typeof(Form1));
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
XmlConfigurator.Configure();
FreqTimers.Start();
}

private void FreqTimers_Tick(object sender, EventArgs e)
{
log.Debug("demo");
}
}
}

with an app.config like 




  

  
  

  
  
  
  
  
  
  

  


  
  

  


If you monitor the application, you see that the memory usage increase. Why? I 
can post the source solution if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (LOG4NET-198) Memory leak on a very basic code

2009-02-06 Thread rauzy (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4NET-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

rauzy updated LOG4NET-198:
--

Attachment: WindowsFormsApplication1.zip

Her is the code for testing

> Memory leak on a very basic code
> 
>
> Key: LOG4NET-198
> URL: https://issues.apache.org/jira/browse/LOG4NET-198
> Project: Log4net
>  Issue Type: Test
>  Components: Core
>Affects Versions: 1.2.10
> Environment: windows xp sp3
>Reporter: rauzy
> Attachments: WindowsFormsApplication1.zip
>
>
> I build a simple form with a single button that start a timer execute every 
> second, the task of this timer is to execute the following line:
> log.Debug("Hello");
> and I observe a memory leak.
> See Below.
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
> using log4net;
> using log4net.Config;
> namespace WindowsFormsApplication1
> {
> public partial class Form1 : Form
> {
> private static readonly ILog log = 
> LogManager.GetLogger(typeof(Form1));
> public Form1()
> {
> InitializeComponent();
> }
> private void button1_Click(object sender, EventArgs e)
> {
> XmlConfigurator.Configure();
> FreqTimers.Start();
> }
> private void FreqTimers_Tick(object sender, EventArgs e)
> {
> log.Debug("demo");
> }
> }
> }
> with an app.config like 
> 
> 
>   
>  type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
>   
>   
>  type="log4net.Appender.RollingFileAppender">
>   
>   
>   
>   
>   
>   
>   
> 
>   
> 
> 
>   
>   
> 
>   
> 
> If you monitor the application, you see that the memory usage increase. Why? 
> I can post the source solution if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (LOG4NET-198) Memory leak on a very basic code

2009-02-06 Thread rauzy (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671377#action_12671377
 ] 

rauzy commented on LOG4NET-198:
---

You can see as well that if you switch the root logging from DEBUG to INFO, you 
don't have a memory leak any more so it should be a dispose method somewhere.

> Memory leak on a very basic code
> 
>
> Key: LOG4NET-198
> URL: https://issues.apache.org/jira/browse/LOG4NET-198
> Project: Log4net
>  Issue Type: Test
>  Components: Core
>Affects Versions: 1.2.10
> Environment: windows xp sp3
>Reporter: rauzy
> Attachments: WindowsFormsApplication1.zip
>
>
> I build a simple form with a single button that start a timer execute every 
> second, the task of this timer is to execute the following line:
> log.Debug("Hello");
> and I observe a memory leak.
> See Below.
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
> using log4net;
> using log4net.Config;
> namespace WindowsFormsApplication1
> {
> public partial class Form1 : Form
> {
> private static readonly ILog log = 
> LogManager.GetLogger(typeof(Form1));
> public Form1()
> {
> InitializeComponent();
> }
> private void button1_Click(object sender, EventArgs e)
> {
> XmlConfigurator.Configure();
> FreqTimers.Start();
> }
> private void FreqTimers_Tick(object sender, EventArgs e)
> {
> log.Debug("demo");
> }
> }
> }
> with an app.config like 
> 
> 
>   
>  type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
>   
>   
>  type="log4net.Appender.RollingFileAppender">
>   
>   
>   
>   
>   
>   
>   
> 
>   
> 
> 
>   
>   
> 
>   
> 
> If you monitor the application, you see that the memory usage increase. Why? 
> I can post the source solution if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (LOG4NET-198) Memory leak on a very basic code

2009-02-06 Thread rauzy (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671377#action_12671377
 ] 

lecedre edited comment on LOG4NET-198 at 2/6/09 3:59 PM:
---

You can see as well that if you switch the root logging from DEBUG to INFO, you 
don't have a memory leak any more so it should be a dispose method somewhere 
which is missing

  was (Author: lecedre):
You can see as well that if you switch the root logging from DEBUG to INFO, 
you don't have a memory leak any more so it should be a dispose method 
somewhere.
  
> Memory leak on a very basic code
> 
>
> Key: LOG4NET-198
> URL: https://issues.apache.org/jira/browse/LOG4NET-198
> Project: Log4net
>  Issue Type: Test
>  Components: Core
>Affects Versions: 1.2.10
> Environment: windows xp sp3
>Reporter: rauzy
> Attachments: WindowsFormsApplication1.zip
>
>
> I build a simple form with a single button that start a timer execute every 
> second, the task of this timer is to execute the following line:
> log.Debug("Hello");
> and I observe a memory leak.
> See Below.
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
> using log4net;
> using log4net.Config;
> namespace WindowsFormsApplication1
> {
> public partial class Form1 : Form
> {
> private static readonly ILog log = 
> LogManager.GetLogger(typeof(Form1));
> public Form1()
> {
> InitializeComponent();
> }
> private void button1_Click(object sender, EventArgs e)
> {
> XmlConfigurator.Configure();
> FreqTimers.Start();
> }
> private void FreqTimers_Tick(object sender, EventArgs e)
> {
> log.Debug("demo");
> }
> }
> }
> with an app.config like 
> 
> 
>   
>  type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
>   
>   
>  type="log4net.Appender.RollingFileAppender">
>   
>   
>   
>   
>   
>   
>   
> 
>   
> 
> 
>   
>   
> 
>   
> 
> If you monitor the application, you see that the memory usage increase. Why? 
> I can post the source solution if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (LOG4NET-195) Log4Net Performance comparison with other logging utility

2009-02-06 Thread Ashish Khandelwal (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671415#action_12671415
 ] 

Ashish Khandelwal commented on LOG4NET-195:
---

Thanks for your response Ron...

Your comment:
It appears that nspring uses background threads to write message to the file. 
Log4net does the writing on the same thread by default. I suspect the large 
time differences you're seeing is due to the fact that nspring is returning 
after it has started the log process...not after all the log entries have 
actually been written to the file. 

You're trying to compare two unrelated things. 

My Question on your comment:
it means, due to Log4Net does the writing on the same thread by default, the 
response time from Log4Net is higher and that's why it affects the performance 
of Business logic. 
I agree that i may be trying to compare two unrelated things. But you know all 
together the functionality of both utility is to write logs into the log file. 
Whatever design/mechanism they follow, i think the Business logic performance 
should not be affected. If it is affecting it means there is problem in the 
design.
As you are saying "Log4net does the writing on the same thread by default", 
does this mean there is a way to change this default behavior? And/or is there 
any way which can boost the performance? Please assist.

Many thanks in advance...

> Log4Net Performance comparison with other logging utility
> -
>
> Key: LOG4NET-195
> URL: https://issues.apache.org/jira/browse/LOG4NET-195
> Project: Log4net
>  Issue Type: Test
>Affects Versions: 1.2.10
> Environment: .Net Framework 2.0, VS 2005, Windows XP
>Reporter: Ashish Khandelwal
>Priority: Critical
> Attachments: Log4Net_Vs_nSpring.zip
>
>
> I developed one utility to compare the performance between Log4Net and 
> nSpring(another logging utility). The result I saw is surprise to me - 
> Log4Net took more time than nSpring. It is surprise because "Log4net claims 
> to be fast and flexible: speed first, flexibility second."
> Log4Net says: 
> (http://logging.apache.org/log4net/release/manual/internals.html)
> One of the often-cited arguments against logging is its computational cost. 
> This is a legitimate concern as even moderately sized applications can 
> generate thousands of log requests. Much effort was spent measuring and 
> tweaking logging performance. Log4net claims to be fast and flexible: speed 
> first, flexibility second.
> Although test is saying Log4Net takes more time, I am still not convinced 
> with the result achieved, considering the fact; Log4Net is widely accepted by 
> the industry and known for its speed, reliability and flexibility.
> I would like to know why Log4Net is taking more time, we might be missing any 
> setting or other which can boost the performance. Can you please help to know 
> the reason?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.