[email protected]
[Top] [All Lists]

Re: LoggerPatternLayout %t resolves to PID

Subject: Re: LoggerPatternLayout %t resolves to PID
From: Knut Urdalen
Date: Sat, 14 Jul 2007 01:16:15 +0200
Christian Hammers wrote:
Hello

I found it somewhat confusing that %t gets substituted by the PID and not
the name of the current thread. I had expected $_SERVER['PHP_SELF']. Why is
this?
I see your point. It was directly ported from log4j where %t means the
name of the thread (which is the process ID).
So is %t buggy and do you have any ideas regarding my multi-application
logfile?

You can use MDC (mapped diagnostic context) to resolve this:

LoggerMDC::put('filename', __FILE__);

on the top of the file. And use:

%X{filename}

somewhere in your pattern layout to get the current filename.

Regards,
Knut Urdalen


<Prev in Thread] Current Thread [Next in Thread>