List Info

Thread: Re: LoggerPatternLayout %t resolves to PID




Re: LoggerPatternLayout %t resolves to PID
user name
2007-07-13 18:16:15
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

somewhere in your pattern layout to get the current
filename.

Regards,
Knut Urdalen



[1]

about | contact  Other archives ( Real Estate discussion Medical topics )