This is the property...

log4j.appender.File.file=/myprojectlogs/myproject.log

And this is the error...

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: \myprojectlogs\myproject.log (The system
cannot find the path
 specified)

We have a startup servlet (currently) that actually loads up the file
and thus allows for changes on the fly as it checks the file
periodically. That looks like this.

                try {
                        file =
OurProjectProperties.getProperty("log4j_properties");
                } catch (ConfigurationException e1) {
                        file = getInitParameter("log4j-init-file");
                        e1.printStackTrace();
                }

Not sure if that makes a difference or not.

Preston

>>> [EMAIL PROTECTED] 10/31/2005 12:47 PM >>>
That should work just fine.  Is a typo possible?  Do all directories
in the path exist?  What is the exact error message?

On 10/31/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> Just tried that and it didn't work, unfortunately. It through a
> FileNotFoundException during startup of Tomcat.
>
> Preston
>
> >>> [EMAIL PROTECTED] 10/28/2005 9:50 PM >>>
> At 08:32 PM 10/28/2005 -0700, you wrote:
>  >Is this possible? I'd like my log4j.properties to be portable
> between
>  >Linux and Windows without having to change which one got deployed
in
> ant
>  >or something like that. But I thought I'd ask first. The idea
being
> if
>  >this line...
>  >
>  >log4j.appender.File.file=c:/logs/myproject.log
>  >
>
> Use a Unix-like path.  If the working directory of your VM is on the
> "C:"
> drive, then just do...
>
> log4j.appender.File.file=/logs/myproject.log
>
> the leading "/" will cause Java to look to the root of the current
> drive.
>
>
> Jake
>
>  >could be turned into something that could be universal to Windows
> and
>  >Linux/Unix.
>  >
>  >Any ideas?
>  >
>  >Preston
>  >
>
>
>---------------------------------------------------------------------
>  >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] 
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/ 

---------------------------------------------------------------------
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]

Reply via email to