You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by pu...@abnamro.com on 2006/05/16 05:56:57 UTC

Need Help on 'How to log output in 2 log files'

Hi All,

Scenario: There are two projects (Project1 & project2) in an Enterprise 
Application (EAR) file. Project1 has to log output in one File1.log and 
Project2 has to log output in File2.log. I created log4j1.props & 
log4j2.props for Project1 & Project2 respectively, then loaded the 
properties file in Properties object and then passed the Properties object 
to PropertyConfigurator.configure() method.

Issue: As soon as the PropertyConfigurator.configure() is called in one 
project it overwrites the settings of other project. As a result, both 
projects start loggin in the same file.

Would be happy to know if someone has a solution for this.

Thanks & regards,
Puneet Bansal
Office: +1 (312) 904 7784 (Internal: 47784)
Cell:     +1 (201) 328 6121
email:  puneet.bansal@abnamro.com

---------------------------------------------------------------------------
This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. ABN AMRO Bank N.V, which has its seat at Amsterdam, the Netherlands, and is registered in the Commercial Register under number 33002587, including its group companies, shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------

Re: Need Help on 'How to log output in 2 log files'

Posted by James Stauffer <st...@gmail.com>.
This has been discussed a lot.  Depending on your app server you can
just put the properties file and log4j.xml in WEB-INF/classes and
WEB-INF/lib (respectively).  Search for more details.

On 5/15/06, puneet.bansal@abnamro.com <pu...@abnamro.com> wrote:
> Hi All,
>
> Scenario: There are two projects (Project1 & project2) in an Enterprise
> Application (EAR) file. Project1 has to log output in one File1.log and
> Project2 has to log output in File2.log. I created log4j1.props &
> log4j2.props for Project1 & Project2 respectively, then loaded the
> properties file in Properties object and then passed the Properties object
> to PropertyConfigurator.configure() method.
>
> Issue: As soon as the PropertyConfigurator.configure() is called in one
> project it overwrites the settings of other project. As a result, both
> projects start loggin in the same file.
>
> Would be happy to know if someone has a solution for this.
>
> Thanks & regards,
> Puneet Bansal
> Office: +1 (312) 904 7784 (Internal: 47784)
> Cell:     +1 (201) 328 6121
> email:  puneet.bansal@abnamro.com
>
> ---------------------------------------------------------------------------
> This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. ABN AMRO Bank N.V, which has its seat at Amsterdam, the Netherlands, and is registered in the Commercial Register under number 33002587, including its group companies, shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
> ---------------------------------------------------------------------------
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org