Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1070452 - [GSS] (6.3.0) System.out.println() doesn't work when using per-deployment logging
[GSS] (6.3.0) System.out.println() doesn't work when using per-deployment log...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: DR0
: EAP 6.3.0
Assigned To: James Perkins
Nikoleta Ziakova
Russell Dickenson
:
Depends On:
Blocks: 1059857 1070453
  Show dependency treegraph
 
Reported: 2014-02-26 16:30 EST by Kyle Lape
Modified: 2014-06-28 11:44 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previous versions of JBoss EAP 6 carried a bug that prevented the `System.out.println()` method from printing to log files when per-deployment logging was in use. This bug was resolved with an upstream patch.
Story Points: ---
Clone Of:
: 1070453 (view as bug list)
Environment:
Last Closed: 2014-06-28 11:44:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Reproducer maven project (1.81 KB, application/x-bzip)
2014-04-28 15:10 EDT, Kyle Lape
no flags Details

  None (edit)
Description Kyle Lape 2014-02-26 16:30:47 EST
Say you have the file META-INF/log4j.xml:

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
  <appender name="FILE" class="org.apache.log4j.FileAppender">
    <param name="File" value="test.log"/>
    <param name="Append" value="true"/>
    <param name="DatePattern" value="'.'yyyy-MM-dd"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c:%L] %m%n"/>
    </layout>
  </appender>
  <category name="com.redhat.gss.logging">
    <priority value="INFO"/>
  </category>
  <root>
    <appender-ref ref="FILE"/>
  </root>
</log4j:configuration>

And then you do this in some application code:

    System.out.println("system.out.println statement");

This logging statement will not be logged on the console, server.log, or test.log.  It's nowhere to be found.
Comment 1 Kyle Lape 2014-02-26 17:01:02 EST
This commit fixes the issue upstream:

https://github.com/jboss-logging/log4j-jboss-logmanager/commit/fbd434606173376c9be80d051cbf586c0a1e031b

But if that can't be backported as-is, then perhaps we need to figure out specifically what fixed the problem and use that to fix the issue in EAP 6.
Comment 2 Kabir Khan 2014-04-04 10:42:51 EDT
Setting to ON_QA since upgrade should fix this
Comment 3 Nikoleta Ziakova 2014-04-28 10:44:23 EDT
Kyle,
could you please provide a reproducer for this issue? I tried the log4j.xml from the description (with log4j quickstart example application) and the logging statement is always logged in console and server.log (for both EAP 6.2.0.GA and EAP 6.3.0.ER2).
Comment 4 Kyle Lape 2014-04-28 15:10:14 EDT
Created attachment 890562 [details]
Reproducer maven project

To run reproducer, start JBoss and then run `mvn jboss-as:deploy`.  If you have JBOSS_HOME set in the reproducer environment, you can run ./request.sh, and this will invoke a JAX-WS enpoint that will log some messages via Log4J as well as System.out.println().  The script will then print the last few lines of the isolated Log4J log file created by the application.  

Before the patch is applied, the last line should be something like:

12:04:44,599 ERROR [some.other.LoggingClass] (http-/127.0.0.1:8080-1) ERROR

This is because the System.out.println() is not printed.  When the patch is applied, you should see something like this as the last line:

12:09:52,566 INFO  [stdout] (http-/127.0.0.1:8080-1) System.out goes here
Comment 5 Nikoleta Ziakova 2014-04-29 02:34:40 EDT
Thank you, Kyle.
Comment 6 Nikoleta Ziakova 2014-04-29 02:49:30 EDT
Verified with EAP 6.3.0 ER2.
Comment 7 sgilda 2014-05-12 15:57:32 EDT
Changed <literal></literal> tags in Doc Text to ticks (`) to fix Bug 1096865

Note You need to log in before you can comment on or make changes to this bug.