views:

90

answers:

2

How can I set name of the worker thread in Quartz.net?

[2009-12-15 08:56:25] [DefaultQuartzScheduler_Worker-1] INFO

I wanted to see some meaningful information in the logs. I tried using JobDetail constructor, but looks like I am wrong.

 var job = new JobDetail("n1", null, typeof (MyJob));

Thanks, Vadi

A: 

Usually you would be interested in what jobs output (they should have their own loggers) and not interested in the thread.

Do you have a specific case where you need logical names for threads? The threads are pooled and there are no guarantees about which thread gets what kind of job to to process. That's why the thread name usually is usable only for debug purposes to track the things happened in specific thread's life-cycle.

Marko Lahma
Yes, it is purely for debug purpose and also I think naming these threads (atleast prefixes) would help to audit logs later on if something goes wrong
Vadi
A: 

Atleast there is no way to set the name of the worker thread. However, I have used %property facility of log4net to produce meaningful thread name in log files

Vadi