JBOSS EAP 6.1- Unable to view system.out.println output in console and server logs
Asked Answered
T

4

5

I am unable to view any logs in server.log file or in the Jboss output console. It's hard for me to debug the code since I am unable to print "System.out.println()" also in the console.

Earlier I was using JBOSS 4.0.5 server and was able to view the logs in console and server log file. But when we migrated to JBOSS EAP 6.1 I am unable to view the system.out.println output for debugging purpose.

I read that jboss eap 6.1 does not use log4j to generate logs. So there should be a way to resolve this issue for Jboss Eap 6.1 (standalone.xml) I checked to see in standalone .xml and this already exists:

<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>    

please help any one. thank you!

here is the log I see in JBOSS EAP 6.1 console :

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"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tenner answered 22/11, 2013 at 17:15 Comment(0)
P
8
  1. Login to JBOSS console
  2. Click Configuration tab at the top
  3. Click System Properties under General Configuration
  4. Click Add button and add

    Name: org.jboss.as.logging.per-deployment

    Value: false

  5. Restart Jboss

  6. Now you see SOPs in the main console

Psilomelane answered 8/5, 2016 at 16:29 Comment(0)
B
2

Try setting

-Dorg.jboss.as.logging.per-deployment=false

in your standalone.conf.bat, like this:

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

That should do it.

Brimful answered 22/11, 2013 at 17:55 Comment(3)
@Tenner have you checked that there is no logging.properties, log4j.xml files in your deployment package?Brimful
I checked the package and there is logging.properties in the JBOSS_HOME\standalone\configuration\ do i need to change anything in this ?Tenner
@Tenner no, you don't have to do anything about that. I asked about the deployment package. That's not part of deployment package.Brimful
M
1

I believe system.out.println is treated as INFO level log output...

10:51:12,581 INFO [stdout] (http-/0.0.0.0:8443-2) system out println test 10:51:13,971 ERROR [stderr] (http-/0.0.0.0:8443-2) system err printin test

So you'll need to set your logging level for your console, or whatever appender to INFO or greater. Also the root logger level should be set.

Materialism answered 21/2, 2014 at 18:51 Comment(0)
A
0

You can try with :

<level name="DEBUG"/>

restart jboss in debug and debug your application and you see the console and the server.log

Actinal answered 4/3, 2015 at 2:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.