log4J: could not able to see the log file
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rama_Vadakattu
Posted On:   Friday, November 2, 2007 10:41 AM

i am working on Eclipse IDE I encountered the following problem ----------------------- 1) if i use the absolute path for the parameter File in appender like below Then i am able to see the log file at that path. ---------------------------- if i use relative path for the parameter File in appender like below I could not able to find the file no where in the drive where the Web-App is running. I could not able to find out why it is behaving like this? Can anyone please guide me on how to resolve the above issue?    More>>

i am working on Eclipse IDE
I encountered the following problem
-----------------------
1) if i use the absolute path for the parameter File in appender like below



Then i am able to see the log file at that path.
----------------------------
if i use relative path for the parameter File in appender like below




I could not able to find the file no where in the drive where the Web-App is running.

I could not able to find out why it is behaving like this?
Can anyone please guide me on how to resolve the above issue?    <<Less

Re: log4J: could not able to see the log file

Posted By:   Stephen_McConnell  
Posted On:   Saturday, November 3, 2007 10:50 PM

I have noticed this, too.


There is a Java Environmental variable that gives the path to your application.... You can get a list of them by checking in the JavaDocs under java.lang.System.getProperties().


Because Unix, Linux, Windoz and the AS/400 all use different file paths, I often will get that environmental varable and use it as a prefix to where I want to put my log file.


A relative path will not work for log files, because the Logger has NO CLUE where the project is located. You also may want to have your log file in an area on a Mapped drive (not a real good idea, 'cause when you loose the mapping the logger breaks), or in a totally different area on your server than in your app web file.


Stephen McConnell

Re: log4J: could not able to see the log file

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, November 3, 2007 09:36 AM

your question to investigate is "relative to WHAT?" .....
About | Sitemap | Contact