All pastes #931805 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-07 11:00 UTC
rendered paste body
using System;
using System.Threading;
using log4net;
namespace logtest
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			Thread.CurrentThread.Name = "main";
			
			log4net.Config.XmlConfigurator.Configure();
			ILog log = LogManager.GetLogger(typeof(MainClass));
			log.Info("Starting Test");
			
			Thread thread1 = new Thread(Thread1);
			thread1.Name = "thread1";
			
			Thread thread2 = new Thread(Thread2);
			thread2.Name = "thread2";
			
			thread1.Start();
			thread2.Start();
			
			
		}
		
		private static void Thread1()
		{
			while(true) {
				Thread.Sleep(5000);
				ILog log = LogManager.GetLogger(typeof(MainClass));
				log.Info("Thread1");
			}
		}
		
		private static void Thread2()
		{
			while(true) {
				Thread.Sleep(5000);
				ILog log = LogManager.GetLogger(typeof(MainClass));
				log.Info("Thread2");
			}
		}
	}
}