R
Rhino
I've finally got my logging issue just about sorted out but there's one
thing that still bothers me.
(It turns out that I was trying to write logs to a directory that didn't
exist and the logging code in java.util.logging doesn't create the
directories for you. I suppose this is reasonable behaviour, all things
considered.)
By experimenting, I've found that when I specify a simple file name, like
baz.log.xml, WITHOUT A PATH in my FileHandler instantiation, and then
execute the program in Eclipse, the log will get created in my Project/xml
directory. That's not really where I want it - I'd prefer it written to my
Project/log directory - so I've been experimenting with trying to write the
file name in such a way that the log gets written to my Project/log
directory.
If I specify the path as "..\\log\\baz.log.xml" and execute the code via an
Ant build within Eclipse, it works perfectly. However, when I execute the
code as a Java application, the JVM complains that it doesn't like that
path. Why am I getting different behaviour in these two situations?
What can I do to make my class write its logs to Project/log and have that
work regardless of whether I execute as a Java application, as an Ant Build
within Eclipse, or even as an Ant Build outside of Eclipse? Is there a
setting I need to change in Eclipse to make this work when running as a
Java application?
I am using Windows XP Professional with SP2. Eclipse is at the 3.5.2 level.
Ant is at the 1.7.1 level.
thing that still bothers me.
(It turns out that I was trying to write logs to a directory that didn't
exist and the logging code in java.util.logging doesn't create the
directories for you. I suppose this is reasonable behaviour, all things
considered.)
By experimenting, I've found that when I specify a simple file name, like
baz.log.xml, WITHOUT A PATH in my FileHandler instantiation, and then
execute the program in Eclipse, the log will get created in my Project/xml
directory. That's not really where I want it - I'd prefer it written to my
Project/log directory - so I've been experimenting with trying to write the
file name in such a way that the log gets written to my Project/log
directory.
If I specify the path as "..\\log\\baz.log.xml" and execute the code via an
Ant build within Eclipse, it works perfectly. However, when I execute the
code as a Java application, the JVM complains that it doesn't like that
path. Why am I getting different behaviour in these two situations?
What can I do to make my class write its logs to Project/log and have that
work regardless of whether I execute as a Java application, as an Ant Build
within Eclipse, or even as an Ant Build outside of Eclipse? Is there a
setting I need to change in Eclipse to make this work when running as a
Java application?
I am using Windows XP Professional with SP2. Eclipse is at the 3.5.2 level.
Ant is at the 1.7.1 level.