[jira] [Commented] (LOG4PHP-224) LoggerLayoutPattern is not safe when used inside pthreads

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Commented] (LOG4PHP-224) LoggerLayoutPattern is not safe when used inside pthreads

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LOG4PHP-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532210#comment-14532210 ]

Andrew Revak commented on LOG4PHP-224:
--------------------------------------

I have already fixed this and am happy to contribute the code and unit tests but this is my first time any guidance on this? I am mainly asking beacuse you could concievably fix this two ways.

One would be to make a separate LoggerLayoutPattern that modifies it's behavior as I specified in the description, but the other involves removing the static variable.  I am unsure how important it is to the contributors for that variable to be static however. I'll gladly submit either.

> LoggerLayoutPattern is not safe when used inside pthreads
> ---------------------------------------------------------
>
>                 Key: LOG4PHP-224
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-224
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.3.0
>            Reporter: Andrew Revak
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you use LoggerLayoutPattern inside a pthread Threadable object because all of it's patterns are defined in the static variable $defaultConverterMap they are basically wiped out by pthreads.  A simple workaround is to simply make a function that generates that map and then is replaced where the map is statically called.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Loading...