This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes log file path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log file path" Watch "log file path" New topic
Author

log file path

ram kri
Greenhorn

Joined: Dec 08, 2005
Posts: 12
i am using log4j api for creating log file

how can i give the path of creating log file in log4j.properties file


windows 2000 is my O.S
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I did it this way:

log4j.appender.dest1.file=${catalina.base}${file.separator}logs${file.separator}my-app.log


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I did it like this:

log4j.appender.standard.file=C:/CMWeb/Log/standard.log
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Moved to the Other Open Source Projects forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
LAT_kNos
Greenhorn

Joined: Dec 12, 2005
Posts: 5
Yeah both of them works well.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: log file path
 
Similar Threads
Help Please -log4j:WARN No appenders could be found for logger
Weblogic 9.2 + log4j : Adding path to log file not working
maintaining a log file on server(Linux-Apachi)
Tomcat crashes
How to create log file outside application