You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Thibaut Barrère <th...@gmail.com> on 2004/10/06 15:04:03 UTC
Does log4net start its own thread ?
Hi,
while trying to put a name on all (numerous) threads in an application
for better diagnostic, I realized that log4net appears to start its
own thread (for all internal work I suppose). I could not find any
trace of that in the documentation / faq / lists, so I maybe wrong
(code below).
Does log4net start a thread on the first LogManager.GetLogger call ?
If it is, it appears that its Name property is not set. This is not
critical but would be helpful to have it named "Log4Net" and easy to
do. What do you think ?
best regards
Thibaut Barrère
using System;
using System.Threading;
using log4net;
namespace ThreadsEnum
{
class ThreadTest
{
[STAThread]
static void Main(string[] args)
{
Thread.CurrentThread.Name="MainThread";
ILog log = LogManager.GetLogger(typeof(ThreadTest));
Console.WriteLine("See how many threads we have by setting a
breakpoint here.");
}
}
}