Re: Problem with Log4j (Configuration)

2004-12-21 Thread Ran//-\\mir

thanks Jake, its working...:)



but whats the detailed solution if i required two different configuration 
files.









 --- On Sat 12/18, Jacob Kjome < [EMAIL PROTECTED] > wrote:

From: Jacob Kjome [mailto: [EMAIL PROTECTED]

To: log4j-user@logging.apache.org

Date: Sat, 18 Dec 2004 11:31:45 -0600

Subject: Re: Problem with Log4j (Configuration)



At 05:20 PM 12/18/2004 +0100, you wrote: > >Amir, > >Are A.txt 
and B.txt the configuration files or the files where logging >output 
goes? >I'm pretty sure he means that the .txt files are his log 
files and since he has two separate configurations, he expects appA's 
output to go to one file (as it was configured in his appA config file) and 
he expects appB's output to go to separate file (as it is configured in his 
appB config file).  The problem is that there is only one config [file] per 
logger repository.  When he says "appA" and "appB", he means two jar files 
in the same application.The answer to this is that the approach is 
flawed.  The way I interpret this is that ApplicationA.jar and 
ApplicationB.jar both have a log4j config file in their roots.  This is a 
bad practice as someone else may use, for instance, ApplicationA.jar in 
their app but not want to have ApplicationA.jar defining their logger 
configuration.  The problem is thinking that configuration is happening 
per/library.  It actually happens per logger repository which, by default, 
is essentially per visible classloader hierarchy.  If a repository selector 
is used, the configuration happens per whatever criteria the selector uses 
as a demarcation of logger repositories.  This can add complexity which is 
necessary at times, but probably not here.Because of this, one 
should not distribute config files in jars.  Logging is for the end user, 
not the creator of the library.  Remove the config files from the libraries 
and use a single config file per/application.  At this point, it is easy to 
send the output of the two libraries (with distinct package names) to 
separate log files...  
I hope that answers the 
question.Jake >At 06:13 AM 12/17/2004, Ran//-\\mir wrote: 
> >>Apologies are mine if this issue is discussed already. >>I have two 
different applications i-e two separate jar files >>(ApplicationA.jar and 
ApplicationB.jar). >>Both use log4j for logging to separate files (A.txt 
and B.txt). >>Now the scenario is >>ApplicationB uses ApplicationA jar 
file. I have placed ApplicationA.jar >>and log4j.jar in WEB_INF/lib folder 
of ApplicationB. When ApplicationB >>runs, I expect to get logs in 
different files but unfortunately this does >>not happen. ApplicationA 
makes some logging in B.txt and ApplicationB in >>A.txt. Though both are 
using different configuration files. >>Is this normal? What is the solution 
to the problem? >>Thanking in advance. >>Amir > >-- >Ceki 
Gülcü > >   The complete log4j manual: http://qos.ch/log4j/ > 
> > 
>- >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]

___
No banners. No pop-ups. No kidding.
Make My Way your home on the Web - http://www.myway.com

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



Re: Problem with Log4j (Configuration)

2004-12-21 Thread Ran//-\\mir

For some reasons it is required ro use different configuration files... 



so whats the second solution of the problem?







 --- On Sat 12/18, Jacob Kjome < [EMAIL PROTECTED] > wrote:

From: Jacob Kjome [mailto: [EMAIL PROTECTED]

To: log4j-user@logging.apache.org

Date: Sat, 18 Dec 2004 11:31:45 -0600

Subject: Re: Problem with Log4j (Configuration)



At 05:20 PM 12/18/2004 +0100, you wrote: > >Amir, > >Are A.txt 
and B.txt the configuration files or the files where logging >output 
goes? >I'm pretty sure he means that the .txt files are his log 
files and since he has two separate configurations, he expects appA's 
output to go to one file (as it was configured in his appA config file) and 
he expects appB's output to go to separate file (as it is configured in his 
appB config file).  The problem is that there is only one config [file] per 
logger repository.  When he says "appA" and "appB", he means two jar files 
in the same application.The answer to this is that the approach is 
flawed.  The way I interpret this is that ApplicationA.jar and 
ApplicationB.jar both have a log4j config file in their roots.  This is a 
bad practice as someone else may use, for instance, ApplicationA.jar in 
their app but not want to have ApplicationA.jar defining their logger 
configuration.  The problem is thinking that configuration is happening 
per/library.  It actually happens per logger repository which, by default, 
is essentially per visible classloader hierarchy.  If a repository selector 
is used, the configuration happens per whatever criteria the selector uses 
as a demarcation of logger repositories.  This can add complexity which is 
necessary at times, but probably not here.Because of this, one 
should not distribute config files in jars.  Logging is for the end user, 
not the creator of the library.  Remove the config files from the libraries 
and use a single config file per/application.  At this point, it is easy to 
send the output of the two libraries (with distinct package names) to 
separate log files...  
I hope that answers the 
question.Jake >At 06:13 AM 12/17/2004, Ran//-\\mir wrote: 
> >>Apologies are mine if this issue is discussed already. >>I have two 
different applications i-e two separate jar files >>(ApplicationA.jar and 
ApplicationB.jar). >>Both use log4j for logging to separate files (A.txt 
and B.txt). >>Now the scenario is >>ApplicationB uses ApplicationA jar 
file. I have placed ApplicationA.jar >>and log4j.jar in WEB_INF/lib folder 
of ApplicationB. When ApplicationB >>runs, I expect to get logs in 
different files but unfortunately this does >>not happen. ApplicationA 
makes some logging in B.txt and ApplicationB in >>A.txt. Though both are 
using different configuration files. >>Is this normal? What is the solution 
to the problem? >>Thanking in advance. >>Amir > >-- >Ceki 
Gülcü > >   The complete log4j manual: http://qos.ch/log4j/ > 
> > 
>- >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]

___
No banners. No pop-ups. No kidding.
Make My Way your home on the Web - http://www.myway.com

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



Re: Problem with Log4j (Configuration)

2004-12-19 Thread Ran//-\\mir

well they are files where output goes And i am using different configuration 
files for both.





 --- On Sat 12/18, Ceki =?iso-8859-1?Q?G=FClc=FC?= < [EMAIL PROTECTED] > wrote:

From: Ceki =?iso-8859-1?Q?G=FClc=FC?= [mailto: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]

Date: Sat, 18 Dec 2004 17:20:27 +0100

Subject: Re: Problem with Log4j (Configuration)



Amir,Are A.txt and B.txt the configuration files or the files where 
logging output goes?At 06:13 AM 12/17/2004, Ran//-\\mir 
wrote:>Apologies are mine if this issue is discussed already.>I 
have two different applications i-e two separate jar files 
>(ApplicationA.jar and ApplicationB.jar).>Both use log4j for logging to 
separate files (A.txt and B.txt).>Now the scenario is>ApplicationB uses 
ApplicationA jar file. I have placed ApplicationA.jar >and log4j.jar in 
WEB_INF/lib folder of ApplicationB. When ApplicationB >runs, I expect to 
get logs in different files but unfortunately this does >not happen. 
ApplicationA makes some logging in B.txt and ApplicationB in >A.txt. Though 
both are using different configuration files.>Is this normal? What is the 
solution to the problem?>Thanking in advance.>Amir-- Ceki 
Gülcü   The complete log4j manual: 
http://qos.ch/log4j/-To
 unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: 
[EMAIL PROTECTED]

___
No banners. No pop-ups. No kidding.
Make My Way your home on the Web - http://www.myway.com

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



Problem with Log4j (Configuration)

2004-12-16 Thread Ran//-\\mir

Apologies are mine if this issue is discussed already. 

I have two different applications i-e two separate jar files (ApplicationA.jar 
and ApplicationB.jar).

Both use log4j for logging to separate files (A.txt and B.txt). 

Now the scenario is 

ApplicationB uses ApplicationA jar file. I have placed ApplicationA.jar and 
log4j.jar in WEB_INF/lib folder of ApplicationB. When ApplicationB runs, I 
expect to get logs in different files but unfortunately this does not happen. 
ApplicationA makes some logging in B.txt and ApplicationB in A.txt. Though both 
are using different configuration files. 

Is this normal? What is the solution to the problem?

Thanking in advance.

Amir

___
No banners. No pop-ups. No kidding.
Make My Way your home on the Web - http://www.myway.com

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



Problem with Log4j ( Configuration)

2004-12-16 Thread Ran//-\\mir
  

Apologies are mine if this issue is discussed already.