Thanks, I didn't see that first example. It appears to be helpful.  I tried to 
xml converter and found 2 problems, 1 it didn't work with the auto loader (I 
installed as a pear plugin) and 2 it didn't appear to get all the settings from 
the XML. Here is the output from the XML below:

Array
(
    [appenders] => Array
        (
            [myAppender] => Array
                (
                    [class] => LoggerAppenderEcho
                    [layout] => Array
                        (
                            [class] => LoggerLayoutTTCC
                        )

                )

        )

    [loggers] => Array
        (
        )

    [renderers] => Array
        (
        )

    [rootLogger] => Array
        (
            [level] => WARN
            [appenders] => Array
                (
                    [0] => myAppender
                )

        )

)

-----Original Message-----
From: Christian Grobmeier [mailto:[email protected]] 
Sent: Tuesday, May 15, 2012 1:51 PM
To: Log4PHP User
Subject: Re: Convert to array from XML

On Tue, May 15, 2012 at 7:34 PM, Michael Sole <[email protected]> wrote:
> We are using log4php quite extensively in our application. We began by 
> using the XML config file but found that too much of a hassle as we 
> end up with lots of them. The array method of configuring loggers 
> seems much more efficient but I am having difficulty converting our 
> xml file to the array. I am sadly not able to find a good enough 
> example to use as a template. Can someone please help me by converting this 
> XML into an array?

Have you seen that for each component is an example for xml and php
(array) available?
F.e. http://logging.apache.org/log4php/docs/appenders/rolling-file.html

A quick start for php configuration:
http://logging.apache.org/log4php/docs/configuration.html

HTH
Christian

>
>
>
> <log4php:configuration 
> xmlns:log4php="http://logging.apache.org/log4php/";>
>
>     <appender name="myAppender" class="LoggerAppenderDailyFile">
>
>                 <layout class="LoggerLayoutTTCC" />
>
>     <param name="datePattern" value="Y-m-d" />
>
>         <param name="file"
> value="/var/www/virtual/derver.net/michael/htdocs/log/michaeldev%s.log
> " />
>
>     </appender>
>
>                 <appender name="myAppender" 
> class="LoggerAppenderEcho">
>
>     <layout class="LoggerLayoutTTCC" />
>
> </appender>
>
>     <root>
>
>         <level value="WARN" />
>
>         <appender_ref ref="myAppender" />
>
>     </root>
>
> </log4php:configuration>
>
>
>
> Also, I have had trouble (in the past) with relative paths in the XML, 
> I assume the array method won’t have these issues?
>
> _______________
>
> Michael F. Sole
> [email protected]
>
> Office: 732.632.8801, ext. 261
> Mobile: 516.592.3683
>
> Fax: 732.632.3599
>
> Gold Mobile
> www.gold-mobile.com
>
> Mobile Health Tech Group
> www.mobilehealthtech.md
>
> This e-mail and any files transmitted are intended solely for the use 
> of the individual or entity to whom they are addressed, and for the 
> use of Gold Mobile.  Any other use is strictly prohibited.
>
>



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

Reply via email to