• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

log4j File-Name

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to log4j.
While using a FileAppender , we mention the file name .
My Question is that in case i just gives the file name where will it
reside(i.e. its location on the disk).
Can i give the absolute path here ?

Thanks in advance ,

Regards,
Mohit.
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mohit,
Be default it yu just give the filename it is created in your current directory of the project.

For example: If you project name is c:\MyProject, thenits going to be created in the Myproject directory.

Rest you can also give absolute path there which was your point of concern or simply Myproject\temp would create the file in temp dire tory which is residing in MyProject.

So i hope now its clear .Incase of any further queries, do let me know.

Saurabh
 
Mohit Agarwal
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Thanks Saurabh for the reply .
I tried out by using a file Appender & naming filename as a.log .
Then the file location turned out be ${CATALINA_HOME}\bin , is it the location that one gets the log file when one just mentions the file name .

When i give the absolute name as ${CATALINA_HOME}\webapps\appName\logs\a.log then there was
log4j:ERROR setFile(null,null) call failed.
java.io.FileNotFoundException : ${CATALINA_HOME}\webapps\appName\logs (Access is denied).

Whats the reason ?

Pls. help me out on this .

Thanks,
Mohit Agarwal.
 
Saurabh Agrawal
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mohit Agarwal:
Hi ,

Thanks Saurabh for the reply .
I tried out by using a file Appender & naming filename as a.log .
Then the file location turned out be ${CATALINA_HOME}\bin , is it the location that one gets the log file when one just mentions the file name .

When i give the absolute name as ${CATALINA_HOME}\webapps\appName\logs\a.log then there was
log4j:ERROR setFile(null,null) call failed.
java.io.FileNotFoundException : ${CATALINA_HOME}\webapps\appName\logs (Access is denied).

Whats the reason ?

Pls. help me out on this .

Thanks,
Mohit Agarwal.



Hi mohit,
Can you please send acroos the code which you have written in log4j.xml or logger.properties file.

I can make further comments looking at them,
Saurabh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic