PropertyConfigurator.doConfigure(URL url, Hierarchy hierarchy),H ierarchy

2002-07-26 Thread Daly, Michael

Would someone be able to provide an explanation how the
PropertyConfigurator.doConfigure(String configFileName, Hierarchy hierarchy)
is intended to be used? I have tried several test classes that use this and
I keep getting the following error messages:

log4j:ERROR No appenders could be found for category (app1).
log4j:ERROR Please initialize the log4j system properly.

Here is my properties file:

log4j.rootCategory=DEBUG

log4j.category.app1=DEBUG, R
log4j.additivity.app1=false

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=app1system.log

log4j.appender.R.MaxFileSize=1000KB
log4j.appender.R.MaxBackupIndex=5

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%c %d %-5p - %m%n

Also, would someone be able to explain how the Hierarchy class is intended
to be used? From the Javadoc, there is a statement "The casual user should
not have to deal with this class directly. In fact, up until version 0.9.0,
this class had default package access. However, if you are in an environment
where multiple applications run in the same VM, then read on." After reading
through the Javadoc, I did not see any references to anything related to
multiple applications running in the same VM.


Michael S. Daly
MerckVaccines.com(TM)
Merck & Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]

--
Notice: This e-mail message, together with any attachments, contains information of 
Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
proprietary copyrighted and/or legally privileged, and is intended solely for the use 
of the individual or entity named on this message. If you are not the intended 
recipient, and have received this message in error, please immediately return this by 
e-mail and then delete it.

==


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Separate properties file for each category

2002-07-24 Thread Daly, Michael

Is there a way to have a properties file defined for each category? I would
like each application within a JVM to be able to configure their application
logging without needing one giant log4j.properties file that every app must
edit (and potentially cause problems for other apps).

Is this possible?

Looking at the Javadocs, it looks like in the PropertyConfigurator there is
a doConfigure(Properties properties, Hierarchy hierarchy) method where it
appears I can assign a set of properties to a hierarchy. Am I on the right
track looking at this?

Michael S. Daly
MerckVaccines.com(TM)
Merck & Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]



--
Notice:  This e-mail message, together with any attachments, contains information of 
Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
proprietary copyrighted and/or legally privileged, and is intended solely for the use 
of the individual or entity named in this message.  If you are not the intended 
recipient, and have received this message in error, please immediately return this by 
e-mail and then delete it.

==


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Logging to separate files

2002-07-22 Thread Daly, Michael

How do I instruct each component to write to the correct logfile?

Michael S. Daly
MerckVaccines.com(TM)
Merck & Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]


-Original Message-
From: Havaldar, Raghu [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 4:29 PM
To: 'Log4J Users List'
Subject: RE: Logging to separate files


There are multiple solutions, a simpler one of which is below:

- create 2 loggers, each hooked with a FileAppender. 
- have your component log to those separate loggers.

example config:

log4j.rootLogger=DEBUG,

log4j.logger.logger1=INFO,fileAppender1
log4j.logger.logger2=INFO,fileAppender2

log4j.appender.fileAppender1=org.apache.log4j.FileAppender
log4j.appender.fileAppender1.File=file1.log

log4j.appender.fileAppender2=org.apache.log4j.FileAppender
log4j.appender.fileAppender2.File=file2.log

-raghu


-Original Message-----
From: Daly, Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 19, 2002 4:55 PM
To: '[EMAIL PROTECTED]'
Subject: Logging to separate files


I have two separate components running as part of a single app. Is there a
way to have each component log to it's own log file? I have not been able to
find an example of this in the docs but I think I saw it eluded to.

If I have two separate apps running in the same JVM, how do I configure
their logging configuration separately?

Michael S. Daly
MerckVaccines.com(TM)
Merck & Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]




--
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that
may be confidential, proprietary copyrighted and/or legally privileged, and
is intended solely for the use of the individual or entity named in this
message.  If you are not the intended recipient, and have received this
message in error, please immediately return this by e-mail and then delete
it.


==


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

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



--
Notice:  This e-mail message, together with any attachments, contains information of 
Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
proprietary copyrighted and/or legally privileged, and is intended solely for the use 
of the individual or entity named in this message.  If you are not the intended 
recipient, and have received this message in error, please immediately return this by 
e-mail and then delete it.

==


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