Hi!

I'm a Log4j newbie and I'm trying to use an existing properties object 
to initialise Log4j 1.1.3, but it doesn't find its properties.

My project has default properties and user specific properties. If I 
place the Log4j settings in the user specific file, everything works 
fine, but when I use the default properties in doesn't work.

That's the error message, that log4j prints, if I set the log4j.debug
property:
log4j: Parsing for [root] with value=[debug, R].
log4j: Priority token is [debug].
log4j: Category root set to DEBUG
log4j: Parsing appender named "R".
log4j: Parsing layout options for "R".
log4j: End of parsing for "R".
log4j:WARN File option not set for appender [R].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
log4j: Parsed "R" options.
log4j: Finished configuring.
log4j:ERROR No output stream or file set for the appender named [R].

That's an extract from my property file (I've taken it from the log4j
manual):

log4j.debug=true
log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example1.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n


And that's my code:

import  org.apache.log4j.Category;
import  org.apache.log4j.PropertyConfigurator;

public class myClass {
private static Category cat;
...

public static void myFunction(Properties oProp)
{
...
cat = Category.getInstance(myClass.class.getName());
// PropertyConfigurator.configure("C:\\log4j_test.properties"); // works
PropertyConfigurator.configure(oProp);

I've checked oProp (with list and propertyNames) and all the properties 
are available.

I hope, somebody can give me a hint, what to do!

Thanks in advance!

Steffen


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

Reply via email to