Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get log4j directory path

 
Rohit Alwar
Greenhorn
Posts: 3
  • 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: 10447
227
IntelliJ IDE Ubuntu
  • Likes 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks It's working
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic