Hi,

On Fri, 25 Oct 2002 00:14, Ole Bulbuk wrote:
> I finally managed to make Phoenix use Log4J automatically.
> It can be configured in the environment.xml file like this:
> <logs type="log4j" version="1.2" configFile="SAR-INF/log4j_config.xml"/>

Thanks!

> For this change I had to modify Phoenix, Excalibur and the Avalon
> framework. The source code is attached to this mail.
> I used the modern Log4J API (Logger instead of Category, etc.) so one
> doesn't get any deprecation warnings anymore.
>
> I hope you find this helpful,

yep. I committed the changes with a few modifications, hope thats okay. 
Firstly I made 

* Didn't change the Framework Logger which will still produces deprecation 
warnings. I think we will need to look at a better strategy than just 
appending 2. Not sure how to deal with things when backwards compat is not 
guarenteed.
* Log4jConfLoggerManager which just extended Log4jLoggerManager and did some 
configuration.

I also modified the Phoenix LogManager so that it accepted a logger version of 
"log4j" and if present would treat the containing content as a log4j 
configuration file. So instead of 

<logs type="log4j" version="1.2" configFile="SAR-INF/log4j_config.xml"/>

you should use

<logs version="log4j">

    <appender name="FILE" class="org.apache.log4j.FileAppender">
        <param name="File" value="foo.txt"/>
        <param name="Append" value="false"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"
                value="%p - %m%n"/>
        </layout>
    </appender>

    <root>
        <priority value="debug"/>
        <appender-ref ref="FILE"/>
    </root>
</logs>

or whatever.

If there is a problem with those changes then just tell us. Anyways would you 
be able to download the latest CVS changes and make sure they work as 
expected for you? I attempted to run it and it seems to work ...

-- 
Cheers,

Peter Donald
*-----------------------------------------------------*
| Never argue with an idiot, they'll drag you down to |
| their level, and beat you with experience           |
*-----------------------------------------------------* 


--
To unsubscribe, e-mail:   <mailto:avalon-users-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>

Reply via email to