Re: using log4j.properties

2007-10-12 Thread Upul Godage
Hi,

One solution, in each aar, you have to call a log4j
PropertyConfigurator.configure(...) or DOMConfigurator.configure(...) at
start up or when you want to reload the log properties.

This is one way of doing it.  Here the service class implements public void
init(ServiceContext sc) which will be called by Axis2 when instantiating the
service class.

The samplelog4j.properties is inside the aar file.

public class Sample {
public void init(ServiceContext sc) {
try {
InputStream inStream = this.getClass
().getClassLoader().getResourceAsStream("samplelog4j.properties");
Properties props = new Properties();
props.load(inStream);
PropertyConfigurator.configure(props);
} catch (Exception e) {
e.printStackTrace();
}
}

   // service methods etc.
}

Hope this helps

Upul



On 10/11/07, Kahler, Jason J (US SSA) <[EMAIL PROTECTED]> wrote:
>
>  Is the a  way to use separate log4j.properties files for different
> services ?
>
> If so how do I add  the property file to my aar file ?
>
> I am using the maven2 plugin.
>
>
>
>
>


using log4j.properties

2007-10-11 Thread Kahler, Jason J (US SSA)
Is the a  way to use separate log4j.properties files for different
services ? 

If so how do I add  the property file to my aar file ?

I am using the maven2 plugin.