You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "igor nadj (JIRA)" <ji...@apache.org> on 2011/06/13 00:43:51 UTC

[jira] [Created] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Allow setting of a default Renderer for all Classes
---------------------------------------------------

                 Key: LOG4PHP-141
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
             Project: Log4php
          Issue Type: Improvement
          Components: Code
    Affects Versions: 2.0
            Reporter: igor nadj


In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by Florian Semm <fl...@gmx.de>.
Am 12.02.2012 10:26, schrieb Ivan Habunek:
> On 12 February 2012 10:16, Christian Grobmeier <grobmeier@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hello,
>
>     i think we have never discussed it at log4php before (just 2
>     people max :-))
>     but I think we should follow "Commit then review". If it is a huge,
>     nasty piece of code we can discuss it before on the mailinglist.
>
>     What do you think guys?
>
>
> I don't mind doing a review for the first few commits. I know how it 
> is when you start and aren't 100% you're not breaking anything. I will 
> do it when I get a little free time. I was wondering myself how to 
> solve this issue, and it will be interesting to see how Florian soved it.
>

Well it's no rocket-science, but I am sure that I forget something. I am 
very happy about the unit-test, they are very helpful.

> If it's a "huge nasty piece", we can make a branch for it.
>

Branches make me always a headache.

> However, I am thinking about making that patch release we have been 
> talking about. Because of this, I would appreciate no new features 
> being committed until we ship this thing.
>
> Regards,
> Ivan



Re: [jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by Ivan Habunek <iv...@gmail.com>.
On 12 February 2012 10:16, Christian Grobmeier <gr...@gmail.com> wrote:

> Hello,
>
> i think we have never discussed it at log4php before (just 2 people max
> :-))
> but I think we should follow "Commit then review". If it is a huge,
> nasty piece of code we can discuss it before on the mailinglist.
>
> What do you think guys?
>
>
I don't mind doing a review for the first few commits. I know how it is
when you start and aren't 100% you're not breaking anything. I will do it
when I get a little free time. I was wondering myself how to solve this
issue, and it will be interesting to see how Florian soved it.

If it's a "huge nasty piece", we can make a branch for it.

However, I am thinking about making that patch release we have been talking
about. Because of this, I would appreciate no new features being committed
until we ship this thing.

Regards,
Ivan

Re: [jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by Christian Grobmeier <gr...@gmail.com>.
Hello,

i think we have never discussed it at log4php before (just 2 people max :-))
but I think we should follow "Commit then review". If it is a huge,
nasty piece of code we can discuss it before on the mailinglist.

What do you think guys?

Cheers
Christian

On Sat, Feb 11, 2012 at 8:45 PM, Florian Semm (Updated) (JIRA)
<ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Florian Semm updated LOG4PHP-141:
> ---------------------------------
>
>    Attachment: LOG4PHP-141.patch
>
> only a patch, because i want a review ;)
>
> it also includes the fix from LOG4PHP-127
>
>> Allow setting of a default Renderer for all Classes
>> ---------------------------------------------------
>>
>>                 Key: LOG4PHP-141
>>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>>             Project: Log4php
>>          Issue Type: Improvement
>>          Components: Code
>>    Affects Versions: 2.0
>>            Reporter: igor nadj
>>         Attachments: LOG4PHP-141.patch
>>
>>
>> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>



-- 
http://www.grobmeier.de
https://www.timeandbill.de

[jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Florian Semm (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florian Semm updated LOG4PHP-141:
---------------------------------

    Attachment: log4php-21-02-2012.patch
    
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch, log4php-21-02-2012.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Ivan Habunek (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek updated LOG4PHP-141:
---------------------------------

    Fix Version/s:     (was: 2.2)

Not planned for 2.2.
                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0
>            Reporter: igor nadj
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Ivan Habunek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek closed LOG4PHP-141.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.0
         Assignee: Ivan Habunek

I have finished the implementation. Florian, I have made some changes to make the whole thing simpler.

All renderers should implement LoggerRenderer interface. LoggerRendererObject has been removed since it's identical. LoggerRendererDefault is the initial default renderer which can be replaced by a custom one. 

See new docs here:
http://bezdomni.net/log4php/docs/renderers.html

                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>            Assignee: Ivan Habunek
>             Fix For: 2.3.0
>
>         Attachments: LOG4PHP-141.patch, log4php-21-02-2012.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Ivan Habunek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek updated LOG4PHP-141:
---------------------------------

    Fix Version/s: 2.2

Sounds like a good idea. We will look into this for v2.2.

Thanks, Igor.

> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0
>            Reporter: igor nadj
>             Fix For: 2.2
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Ivan Habunek (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209252#comment-13209252 ] 

Ivan Habunek commented on LOG4PHP-141:
--------------------------------------

I haven't had a proper look at the code yet because of the work on the release , but I have a few thoughts.

I agree that it would be better to add a new attribute, rather than specifying "Object" for rendered class. Maybe just "defaultRenderer"? Do we plan to have any other renderers apart from object rendererds?

Looking at the naming, I would prefer that the renderer interface be called LoggerRenderer instead of LoggerRendererInterface. To keep the same naming scheme as LoggerConfigurator interface.

This is just some initial ideas. I will have a better look at the code for the weekend. 

Cheers!

                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Florian Semm (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florian Semm updated LOG4PHP-141:
---------------------------------

    Attachment: LOG4PHP-141.patch

only a patch, because i want a review ;)

it also includes the fix from LOG4PHP-127
                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by Florian Semm <fl...@gmx.de>.
Am 21.02.2012 11:29, schrieb Ivan Habunek:
> Hi Florian,
>
> Sorry, not having much free time recently.
>
> I'm looking at your patch now and it seems a little broken. For start,
> the tests fail in many interesting ways. :)
>
> I notice that you deleted LoggerRendererObject, but it's still
> referenced in code. Also you are missing LoggerRendererInterface.
> Maybe this was accidental. Can you have a look?
>
> I agree we need two attributes.
>
> Regards,
> Ivan
>
>
>
> On 21 February 2012 07:57, Florian Semm<fl...@gmx.de>  wrote:
>> Am 16.02.2012 12:01, schrieb Florian Semm (Commented) (JIRA):
>>
>>      [
>> https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209270#comment-13209270
>> ]
>>
>> Florian Semm commented on LOG4PHP-141:
>> --------------------------------------
>>
>> at the moment there are two default-renderer: one for objects, another for
>> string/number/whatever. if we keep this default-renderer we need two new
>> attributes.
>>
>> to change the naming is no problem.
>>
>>
>> Allow setting of a default Renderer for all Classes
>> ---------------------------------------------------
>>
>>                  Key: LOG4PHP-141
>>                  URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>>              Project: Log4php
>>           Issue Type: Improvement
>>           Components: Code
>>     Affects Versions: 2.0.0
>>             Reporter: igor nadj
>>          Attachments: LOG4PHP-141.patch
>>
>>
>> In log4j you can set a default renderer for all Classes by configuring a
>> Renderer for the Object class, as all Classes extend Object. But PHP does
>> not have a base class like Java, and it would be nice to have a way to
>> replicate this behaviour.
>>
>> --
>> This message is automatically generated by JIRA.
>> If you think it was sent incorrectly, please contact your JIRA
>> administrators:
>> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>>
>> Hi,
>>
>> any new opinions about that?
>>
>>
>> regards,
>>
>> Florian
Hi,

I've created another patch: log4php-21-02-2012.patch

It includes all my last changes on the objectes renderer.


regards,

Florian

ps: my tests are green ;)

Re: [jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by Ivan Habunek <iv...@gmail.com>.
Hi Florian,

Sorry, not having much free time recently.

I'm looking at your patch now and it seems a little broken. For start,
the tests fail in many interesting ways. :)

I notice that you deleted LoggerRendererObject, but it's still
referenced in code. Also you are missing LoggerRendererInterface.
Maybe this was accidental. Can you have a look?

I agree we need two attributes.

Regards,
Ivan



On 21 February 2012 07:57, Florian Semm <fl...@gmx.de> wrote:
> Am 16.02.2012 12:01, schrieb Florian Semm (Commented) (JIRA):
>
>     [
> https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209270#comment-13209270
> ]
>
> Florian Semm commented on LOG4PHP-141:
> --------------------------------------
>
> at the moment there are two default-renderer: one for objects, another for
> string/number/whatever. if we keep this default-renderer we need two new
> attributes.
>
> to change the naming is no problem.
>
>
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a
> Renderer for the Object class, as all Classes extend Object. But PHP does
> not have a base class like Java, and it would be nice to have a way to
> replicate this behaviour.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA
> administrators:
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
> Hi,
>
> any new opinions about that?
>
>
> regards,
>
> Florian

Re: [jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by Florian Semm <fl...@gmx.de>.
Am 16.02.2012 12:01, schrieb Florian Semm (Commented) (JIRA):
>      [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209270#comment-13209270 ]
>
> Florian Semm commented on LOG4PHP-141:
> --------------------------------------
>
> at the moment there are two default-renderer: one for objects, another for string/number/whatever. if we keep this default-renderer we need two new attributes.
>
> to change the naming is no problem.
>
>> Allow setting of a default Renderer for all Classes
>> ---------------------------------------------------
>>
>>                  Key: LOG4PHP-141
>>                  URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>>              Project: Log4php
>>           Issue Type: Improvement
>>           Components: Code
>>     Affects Versions: 2.0.0
>>             Reporter: igor nadj
>>          Attachments: LOG4PHP-141.patch
>>
>>
>> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
Hi,

any new opinions about that?


regards,

Florian

[jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Florian Semm (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209270#comment-13209270 ] 

Florian Semm commented on LOG4PHP-141:
--------------------------------------

at the moment there are two default-renderer: one for objects, another for string/number/whatever. if we keep this default-renderer we need two new attributes. 

to change the naming is no problem. 
                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Florian Semm (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226930#comment-13226930 ] 

Florian Semm commented on LOG4PHP-141:
--------------------------------------

i have add an extra option to the renderer:

'renderers' => array(
 	array('defaultObjectRenderer' => 'CustomObjectRenderer')
 ),

if there are other options like 'renderedClass' or 'renderingClass', there will be rejected.
                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch, log4php-21-02-2012.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (LOG4PHP-141) Allow setting of a default Renderer for all Classes

Posted by "Florian Semm (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4PHP-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209197#comment-13209197 ] 

Florian Semm commented on LOG4PHP-141:
--------------------------------------

i have modified my last solution: you can setup your own costum-object renderer. it will overwrite the default-object renderer (see last patch).

the setup looks like this:

'renderers' => array(
 	array('renderedClass' => 'Object', 'renderingClass' => 'CostumDefaultRenderer')
 )

it isn't semantic correct, so i don't like this solution so much. maybe it's better to create an new attribute like 'defaultObjectRenderer'
                
> Allow setting of a default Renderer for all Classes
> ---------------------------------------------------
>
>                 Key: LOG4PHP-141
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-141
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.0.0
>            Reporter: igor nadj
>         Attachments: LOG4PHP-141.patch
>
>
> In log4j you can set a default renderer for all Classes by configuring a Renderer for the Object class, as all Classes extend Object. But PHP does not have a base class like Java, and it would be nice to have a way to replicate this behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira