如何在Java中使用Log4j逐步配置jboss 6.x中的日志记录 [英] How to Step By Step configure logging in jboss 6.x with Log4j in Java

查看:187
本文介绍了如何在Java中使用Log4j逐步配置jboss 6.x中的日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是Jboss的新手,因此在Jboss 6.1中设置日志记录时会感到困惑 我已经在计算机上下载并解压缩了Jboss( jboss-eap-6.1 ),然后按照

Hi all I am new to Jboss so I am get confused while setting up an logging in Jboss 6.1 what I does I have download and extract the Jboss (jboss-eap-6.1) on my machine then I follow the steps given in this article but still I not able to see the logging on console or in file

我在Google上搜索了一下,才知道我必须在/META-INF/下编写 jboss-deployment-structure.xml 文件. strong>文件夹,并且必须在服务器的启动中添加 -Dorg.jboss.as.logging.per-deployment = false 必须通过此链接

the I google it around and come to know that I have to write jboss-deployment-structure.xml file under /META-INF/ folder and have to add -Dorg.jboss.as.logging.per-deployment=false to the start-up of the server (which I dont know where I have to set this) from this link

所以任何人都可以给我一些步骤,用Log4j在jboss 6.x中配置日志记录,或者像java.util.logging这样的任何日志记录,以便在控制台或文件中记录语句.

so can any one give me steps to configure logging in jboss 6.x with Log4j or any logging like java.util.logging to log statements on console or in file thanks.

推荐答案

您应该在Jboss的/bin文件夹中找到standalone.bat文件,然后应该编辑此文件,找到下一行

You should find the standalone.bat file into the /bin folder of Jboss, then you should edit this file, finding the next line

rem Setup JBoss specific properties
set JAVA_OPTS=-Dprogram.‌​name=%PROGNAME% %JAVA_OPTS%

并替换为此

set "JAVA_OPTS= -Dorg.jboss.as.logging.per-deployment=false"

这篇关于如何在Java中使用Log4j逐步配置jboss 6.x中的日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆