It's not a secret anymore!*
The moose likes Java in General and the fly likes Log4j is not able to write the files to jetty logs directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Log4j is not able to write the files to jetty logs directory" Watch "Log4j is not able to write the files to jetty logs directory" New topic
Author

Log4j is not able to write the files to jetty logs directory

Sumukh Deshpande
Ranch Hand

Joined: Feb 17, 2008
Posts: 87

I have an application running on Jetty 8.0.

I have configured the log4j to write the logs to a file. Here is the configuration.




I have even set the permission for the user which is running the Jetty instance.

The log directory of the Jetty has following permissions:




But still getting exception.



Can someone guide me on what could be done to solve this problem?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You forgot to specify the full path to the log file. So the result is that log4j tries to write to Jetty's current working directory, rather than to its log directory. Which it doesn't have the authority to do, but that doesn't matter because it isn't what you want anyway.
Sumukh Deshpande
Ranch Hand

Joined: Feb 17, 2008
Posts: 87

Paul,
I tried specifying the path as {$jetty.home}.

But it instead created a directory by that name in the installation folder of Jetty .

What path should be specified when running the app on Jetty ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Log4j is not able to write the files to jetty logs directory
 
Similar Threads
Jetty can't seem to find an inner class
FreeMarker template error!
log4j XML properties file problem.
log4j - email
Separate log file