How do you specify an external log4j properties file to run a jboss server with?
I need to do this with bash/ terminal commands? Not programmatically
How do you specify an external log4j properties file to run a jboss server with?
I need to do this with bash/ terminal commands? Not programmatically
Create a folder to store log4j.properties
(i.e C:\PropertiesFolder
).
Then add the link to this folder to JBoss classpath:
[server folder]\bin
run.bat
(if server is running on Windows) or run.sh
(for Linux)Snippet:
if "x%JBOSS_CLASSPATH%" == "x" (
set "RUN_CLASSPATH=%RUNJAR%;C:\PropertiesFolder;"
) else (
set "RUN_CLASSPATH=%JBOSS_CLASSPATH%;%RUNJAR%;C:\PropertiesFolder;"
)
Finally restart the server then run by command line (go to [server folder]\bin
then type run
)
You can put the log4j.properties file in the classpath.
If the target version of Jboss is 7.1.x - then you need to follow the simple 2 steps, that are described in the official documentation.
How do I use log4j.properties or log4j.xml instead of using the logging subsystem configuration?
https://docs.jboss.org/author/display/AS71/How+To#HowTo-HowdoIuselog4j.propertiesorlog4j.xmlinsteadofusingtheloggingsubsystemconfiguration%3F
Hope that helps