• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j: How to retrieve RollingFileAppender's file name and path?

 
Guy Home
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone tell me how I can retrieve the file name and path of my Log4j log file from within my java application code?

i.e how can I get my app to return log4j.appender.R.File below as held in my log4j.properties?


# ***** R is set to be a RollingFileAppender.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/blah/xxx.log


I'm sure it ought to be pretty simple so many thinaks if you can offier me the answer.
 
Guy Home
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did work out my own answer to this one, so for anyone else who might need it:



This would output:
"Logging to: \blah\xxx.log"

I've used this successfully in http://gmdx.net/log4j/
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic