如何指定一个外部log4j属性文件来启动jboss服务器?[英] How do you specify an external log4j properties file to start a jboss server?

本文是小编为大家收集整理的关于如何指定一个外部log4j属性文件来启动jboss服务器?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

您如何指定使用?

运行JBOSS服务器的外部log4j属性文件

我需要使用bash/终端命令执行此操作?没有编程

推荐答案

创建一个文件夹以存储log4j.properties(即C:\PropertiesFolder).
然后将此文件夹链接添加到JBOSS ClassPath:

  1. 转到[server folder]\bin
  2. 编辑run.bat(如果服务器在Windows上运行)或run.sh(对于Linux)
  3. 通过添加文件夹链接:
  4. 编辑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

希望有帮助

本文地址:https://www.itbaoku.cn/post/1575088.html

问题描述

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:

  1. Go to [server folder]\bin
  2. Edit run.bat (if server is running on Windows) or run.sh (for Linux)
  3. 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?

https://docs.jboss.org/author/display/AS71/How+To#HowTo-HowdoIuselog4j.propertiesorlog4j.xmlinsteadofusingtheloggingsubsystemconfiguration%3F

Hope that helps