java - JBOSS EAP 6.1- 无法在控制台和服务器日志中查看 system.out.println 输出

标签 java jboss7.x netbeans-7

我无法查看 server.log 文件或 Jboss 输出控制台中的任何日志。我很难调试代码,因为我也无法在控制台中打印“System.out.println()”。

早些时候我使用 JBOSS 4.0.5 服务器并且能够查看控制台和服务器日志文件中的日志。
但是当我们迁移到 JBOSS EAP 6.1 时,我无法查看 system.out.println 输出以进行调试。

我读到 jboss eap 6.1 不使用 log4j 生成日志。所以Jboss Eap 6.1(standalone.xml)应该有办法解决这个问题
我检查了在独立的 .xml 中查看,这已经存在:

<subsystem xmlns="urn:jboss:domain:logging:1.2">
   <console-handler name="CONSOLE">
      <level name="INFO"/>
       <formatter>
      <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
     </formatter>
   </console-handler>    

请帮助任何人。谢谢你!

这是我在 JBOSS EAP 6.1 控制台中看到的日志:
Calling "C:\jboss-eap-6.1\bin\standalone.conf.bat"
"JAVA_OPTS already set in environment; overriding default settings with values: -Xms128m -Xmx512m -XX:MaxPermSize=256m"
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: C:\jboss-eap-6.1

  JAVA: C:\Program Files\Java\jdk1.7.0_21\bin\java

  JAVA_OPTS: -client -Dprogram.name=standalone.bat -Dhttp.proxyHost=proxy.dot.state.mn.us -Dhttp.proxyPort=3128 -Djavax.net.ssl.trustStore=C:\jboss-eap-6.1\jssecacerts -Djavax.net.ssl.trustStorePassword=changeit -Dhttps.proxyHost=proxy.dot.state.mn.us -Dhttps.proxyPort=3128 

===============================================================================

15:13:07,386 INFO  [org.jboss.modules] (main) JBoss Modules version 1.2.0.Final-redhat-1
15:13:07,527 INFO  [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1
15:13:07,574 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) starting
15:13:08,371 INFO  [org.xnio] (MSC service thread 1-4) XNIO Version 3.0.7.GA-redhat-1
15:13:08,387 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
15:13:08,387 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.7.GA-redhat-1
15:13:08,402 INFO  [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.16.GA-redhat-1
15:13:08,418 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 27) JBAS016200: Activating ConfigAdmin Subsystem
15:13:08,418 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
15:13:08,418 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 40) JBAS011906: Activating OSGi Subsystem
15:13:08,418 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
15:13:08,418 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 39) JBAS011800: Activating Naming Subsystem
15:13:08,433 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension
15:13:08,433 INFO  [org.jboss.as.security] (MSC service thread 1-11) JBAS013170: Current PicketBox version=4.0.17.Final-redhat-1
15:13:08,433 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 49) JBAS012605: Activated the following JSF Implementations: [main, 1.2]
15:13:08,512 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-15) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.17.Final-redhat-1)
15:13:08,543 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
15:13:08,558 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-14) JBAS015400: Bound mail session [java:jboss/mail/Default]
15:13:08,746 INFO  [org.jboss.ws.common.management] (MSC service thread 1-10) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.1.3.Final-redhat-3
15:13:08,762 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)
15:13:08,793 INFO  [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/XXXX.8080
15:13:08,808 INFO  [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003000: Coyote HTTP/1.1 starting on: http-/xxx.x.x.x.8080
15:13:08,871 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-eap-6.1\standalone\deployments
15:13:08,887 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on xxx.x.x.x:4447
15:13:08,887 INFO  [org.jboss.as.remoting] (MSC service thread 1-12) JBAS017100: Listening on xxx.x.x.x:9999
15:13:08,887 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "ABCD.war" (runtime-name: "ABCD.war")
15:13:09,012 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-10) JBAS010400: Bound data source [java:jboss/datasources/jdbc/ABCDSelectorDS]
15:13:14,371 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015960: Class Path entry log4j.jar in /C:/jboss-eap-6.1/bin/content/ABCD.war/WEB-INF/lib/commons-logging-1.0.3.jar  does not point to a valid jar for a Class-Path reference.
15:13:14,371 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015960: Class Path entry log4j-core.jar in /C:/jboss-eap-6.1/bin/content/ABCD.war/WEB-INF/lib/commons-logging-1.0.3.jar  does not point to a valid jar for a Class-Path reference.
15:13:14,590 ERROR [org.jboss.as.jsf] (MSC service thread 1-15) JBAS012600: Could not load JSF managed bean class: us.mn.state.dot.ABCD.handler.TreeBean
15:13:15,122 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 10.2)
15:13:15,153 INFO  [org.jboss.web] (ServerService Thread Pool -- 54) JBAS018210: Register web context: /ABCD
15:13:15,168 INFO  [org.apache.catalina.core] (ServerService Thread Pool -- 54) JBWEB001093: The listener org.apache.myfaces.webapp.StartupServletContextListener is already configured for this context, the duplicate definition has been ignored
15:13:15,715 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "ABCD.war" (runtime-name : "ABCD.war")
15:13:15,747 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on xxx.x.x.x.9090/management
15:13:15,747 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on 
15:13:15,747 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) started in 8626ms - Started 595 of 675 services (78 services are passive or on-demand)
15:14:35,784 INFO  [org.jboss.web] (ServerService Thread Pool -- 75) JBAS018224: Unregister web context: /ABCD
15:14:36,097 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015877: Stopped deployment ABCD.war (runtime-name: ABCD.war) in 324ms
15:14:36,097 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "ABCD.war" (runtime-name: "ABCD.war")
15:14:40,863 ERROR [org.jboss.as.jsf] (MSC service thread 1-2) JBAS012600: Could not load JSF managed bean class: us.mn.state.dot.ABCD.handler.TreeBean
15:14:41,066 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-11) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 10.2)
15:14:41,082 INFO  [org.jboss.web] (ServerService Thread Pool -- 87) JBAS018210: Register web context: /ABCD
15:14:41,082 INFO  [org.apache.catalina.core] (ServerService Thread Pool -- 87) JBWEB001093: The listener org.apache.myfaces.webapp.StartupServletContextListener is already configured for this context, the duplicate definition has been ignored
15:14:41,457 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018565: Replaced deployment "ABCD.war" with deployment "ABCD.war"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

最佳答案

  • 登录 JBOSS 控制台
  • 单击顶部的配置选项卡
  • 单击常规配置下的系统属性
  • 单击添加按钮并添加

    名称:org.jboss.as.logging.per-deployment

    值:假
  • 重启Jboss
  • 现在您可以在主控制台中看到 SOP
  • 关于java - JBOSS EAP 6.1- 无法在控制台和服务器日志中查看 system.out.println 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20150680/

    相关文章:

    java - 在 netbeans IDE 7.3 中清理并构建后程序无法运行

    java问题添加/删除面板onclick

    java - 无法在 Nexus 6 上运行应用程序

    java - 如何在 Maven 中表达对 java ee 特性的依赖以过渡到 Java 9?

    java - 使用 hibernate native 查询的错误 BigInteger 结果

    java - 使用 C3P0 运行 JBoss 7 服务器的 Eclipse 项目出现 ClassNotFoundException

    java - jbossstandalone.xml记录器类别到不同的文件

    java - 无法通过 jconn4.jar/Sybase 驱动程序版本 7 和 Mybatis 框架更新 Sybase 数据库中的多条记录

    java - 安全地获取 java.lang.reflect.Method

    java - 在 ubuntu 12.04 中安装 netbeans 时出错