问题描述
您如何指定使用?
运行JBOSS服务器的外部log4j属性文件我需要使用bash/终端命令执行此操作?没有编程
推荐答案
创建一个文件夹以存储log4j.properties(即C:\PropertiesFolder).
然后将此文件夹链接添加到JBOSS ClassPath:
- 转到[server folder]\bin
- 编辑run.bat(如果服务器在Windows上运行)或run.sh(对于Linux)
- 通过添加文件夹链接: 编辑classpath行
摘要:
if "x%JBOSS_CLASSPATH%" == "x" ( set "RUN_CLASSPATH=%RUNJAR%;C:\PropertiesFolder;" ) else ( set "RUN_CLASSPATH=%JBOSS_CLASSPATH%;%RUNJAR%;C:\PropertiesFolder;" )
最终重新启动服务器,然后通过命令行运行(转到[server folder]\bin然后键入run)
其他推荐答案
您可以将log4j.properties文件放在classPath中.
其他推荐答案
如果JBOSS的目标版本为 7.1.x - 那么您需要遵循正式文档中描述的简单2个步骤.
如何使用log4j.properties或log4j.xml而不是使用日志子系统配置?
https://docs.jboss.org/author/display/as71/how+tototto#howto-howdoiuselog4j.propertiesorlog4j.xmlinsteadofusing theLoggingsTheleloggingSubsystemconconfigurationConfigurationConconfiguration%3f; jboss.org/author/display/as71/how+to+to #howto-howdoiuselog4j.propertiesorlog4j.xmlinsteadofusingtheloggingsubgingsubgingsubsystemconfiguration%3f
希望有帮助
问题描述
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:
- Go to [server folder]\bin
- Edit run.bat (if server is running on Windows) or run.sh (for Linux)
- Edit classpath line by adding the folder link:
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?
Hope that helps