P
Pep
I have these 2 lines of code in my test program
private static final Category log = Category.getInstance("TEST");
PropertyConfigurator.configure("TestOutputFile");
and I thought after reading the documentation that this would open a output
file called testOutputFile which log4j would then store the results in
using the following line of code
log.info(message);
except that I get this error message
log4j:ERROR Could not read configuration file [TestOutputFile].
java.io.FileNotFoundException: TestOutputFile (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:297)
at
org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:315)
at uk.co.ticketweb.PSPserver.PSPserver.<init>(PSPserver.java:121)
at uk.co.ticketweb.PSPserver.PSPserver.main(PSPserver.java:980)
log4j:ERROR Ignoring configuration file [TestOutputFile].
which indicates that
PropertyConfigurator.configure("TestOutputFile");
is actually looking to open this file for reading?
I am now confused, I want to open a log file to write the output debug,
info, warn and fatal messages to.
Can anyone tell me what I need to do as I am somewhat confused by the
documentation?
TIA,
Pep.
private static final Category log = Category.getInstance("TEST");
PropertyConfigurator.configure("TestOutputFile");
and I thought after reading the documentation that this would open a output
file called testOutputFile which log4j would then store the results in
using the following line of code
log.info(message);
except that I get this error message
log4j:ERROR Could not read configuration file [TestOutputFile].
java.io.FileNotFoundException: TestOutputFile (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:297)
at
org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:315)
at uk.co.ticketweb.PSPserver.PSPserver.<init>(PSPserver.java:121)
at uk.co.ticketweb.PSPserver.PSPserver.main(PSPserver.java:980)
log4j:ERROR Ignoring configuration file [TestOutputFile].
which indicates that
PropertyConfigurator.configure("TestOutputFile");
is actually looking to open this file for reading?
I am now confused, I want to open a log file to write the output debug,
info, warn and fatal messages to.
Can anyone tell me what I need to do as I am somewhat confused by the
documentation?
TIA,
Pep.