0
votes

I am using log4j 1.2.17 and deploying my application using Jboss EAP 6.2 GA. My log4j is configured using a log4j.properties file that I configured. I wanted output of a DailyRollingFileAppender to go to a directory based on a system variable. So I have it set up like this:

log4j.appender.MAIN.File=${EAP_HOME}/standalone/log/system.log

In the VM Arguments of the server configuration I have:

-DEAP_HOME=${EAP_HOME}

Where EAP_HOME is an Environment Variable I set up.

My Problem is that whenever I try and log, my output goes to EAP_HOME/bin/standalone/log/system.log

I am not sure why it is going to the bin directory when that is not specified anywhere in my settings.

I want it to be in EAP_HOME/standalone/log/system.log

1
Welcome to SO, we're not a forum, we're a Q&A site. Instead of writing the solution into the question, create an answer that you will eventually be able to accept. Adding answer into the question is not welcome. - Jonathan Drapeau
I tried and it would not let because my ranking was not high enough until 8 hours after I posted. - cain4355
Eventually you will be able to, which is the way this site work. Once the time is elapsed, accept your answer, don't write solved in the tittle. Thanks. - Jonathan Drapeau

1 Answers

0
votes

My problem was with how JBoss was grabbing the environment variable in the VM arguments. For some reason it treated $EAP_HOME like a literal string instead of an environment variable. So for now the temporary fix is replacing the $EAP_HOME in the VM argurments of the application server to the string literal path.