File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get log4j directory path

 
Rohit Alwar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How we can get the absolute path of log directory in Java program. I am using jboss server and the configuration is as follow


For log4j.xml
<param name="File" value="${mydir.logdir}/mylog.xml" />

Jboss run.bat entry

run -c local -Dmydir.logdir=c:\logs
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
run -c local -Dmydir.logdir=c:\logs

Since you are passing the absolute path as a system property, you should be able to get it as follows:


 
Rohit Alwar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks It's working
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic