From: ara.t.howard@... Date: 2006-09-15T07:02:09+09:00 Subject: problem - logging for mt programs anyone out there have good ways of dealing with multithreaded logging? my current approach uses a meta programming hack/mutex/etc so that, if the calling thread is the main one, a tid is not written, otherwise it is. thus, I, [2006-09-14T15:41:58.394355 #14588] INFO -- : aquired lock. I, [2006-09-14T15:41:59.225737 #14588] INFO -- : t[-609956564] command shows the first line being logged in the main thread, while the next line is logged by tid -609956564. this is ok. but, obviously, log lines become interleaved at a certian point leading to sections like I, [2006-09-14T15:43:03.486280 #14588] INFO -- : t[-610194194] command I, [2006-09-14T15:43:03.487003 #14588] INFO -- : t[-610194894] tmp_dir I, [2006-09-14T15:43:03.489989 #14588] INFO -- : t[-610194894] command I, [2006-09-14T15:44:18. 45782 #14588] INFO -- : t[-610194894] status <0> I, [2006-09-14T15:44:18. 46468 #14588] INFO -- : t[-610297924] command I, [2006-09-14T15:44:18. 47187 #14588] INFO -- : t[-610299344] command I, [2006-09-14T15:44:18. 50663 #14588] INFO -- : t[-610298484] command I, [2006-09-14T15:44:18. 53356 #14588] INFO -- : t[-610301254] command I, [2006-09-14T15:44:25.361170 #14588] INFO -- : t[-610194194] status <0> I, [2006-09-14T15:44:18. 50663 #14588] INFO -- : t[-610297924] status <0> here, we can certainly track the status of commands back the the line/thread that issued them, but it's pretty painful to to by hand. of course, one could easily post-process in order to analyze... so - has anyone else solved this problem neatly? regards. -a -- in order to be effective truth must penetrate like an arrow - and that is likely to hurt. -- wei wu wei