wood burning stoves 2.0*
The moose likes Servlets and the fly likes creating application log at path specified in Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "creating application log at path specified in Linux" Watch "creating application log at path specified in Linux" New topic
Author

creating application log at path specified in Linux

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
hello guys...

i'm trying to create log file for my application but its not getting created at specified path instead it is creating log file at root

i'm using linux operating system.

how should i specify the path.
above is the log4j.peroperties file where i'm specifing the path.



waiting for your valuable suggestion...

thanks in advance,
[ January 31, 2007: Message edited by: Bear Bibeault ]

Jigar Naik


Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Use this



Rahul Bhattacharjee
LinkedIn - Blog
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Jigar Naik:

log4j.appender.A1.File=//usr//jboss-4.0.2//server//default//log//ToollOG//Tools.log


" // " double forward slash is used for writing comments in Java.

For the path, you could use double backward slash or single forward.

Example:

  • C:\\usr\\jboss-4.0.2\\server\\default\\log\\ToollOG\\Tools.log

  • OR
  • C:/usr/jboss-4.0.2/server/default/log/ToollOG/Tools.log
    [ January 31, 2007: Message edited by: Saif uddin ]

  • Saifuddin..
    [Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: creating application log at path specified in Linux
     
    Similar Threads
    Frontman 2 FileNotFoundException ?
    customize appenders within rootCategory
    thread safe logging in a servlet
    Logging
    Log4j logs debug into info...