It's easy IF you can make sure that the names of the loggers in the
jar don't collide with the names of the loggers in the war.

Suppose all loggers in the jar start with "com.example.jar." and all
loggers in the war start with "com.example.jar."
then you just have to configure two different file-appenders and link
them to the respective logger hierarchy.

Of course, this could be hard to accomplish when your jar and war are
both using the same libraries, and when these libraries have fixed
logger-names.

Maarten

On Tue, Jun 3, 2008 at 7:17 AM, Jacob Kjome <[EMAIL PROTECTED]> wrote:
> The only way I can think of that you would have separate logger repositories 
> in an
> EAR is if you configure the webapp classloader to be parent-last (e.g.
> child-first).  I don't think using a JNDI-based repository selector would
> distinguish between the webapp and the jar in the EAR file.  They'd both be 
> part
> of the same JNDI tree (I could be wrong - only testing will tell).
>
> Jake
>
> lfbarragan wrote:
>> Hi, I have an EAR that includes a JAR and a WAR and I need to setup a
>> separate log file for each one. Currently I have a log4j configuration file
>> for both but when the server is starting the second configuration file is
>> overriding the first one, so all the log messages are being displayed on the
>> file defined on the second configuration file.
>>
>> What should I do to get separate log files for the JAR and the WAR?
>>
>> Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to