Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1031448 - [GSS] (6.3.0) logging-profile works for a servlet, but doesn't for a JSP
[GSS] (6.3.0) logging-profile works for a servlet, but doesn't for a JSP
Status: VERIFIED
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity urgent
: DR2
: EAP 6.4.0
Assigned To: James Perkins
Nikoleta Ziakova
:
Depends On: 1140417
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-17 21:05 EST by Osamu Nagano
Modified: 2018-03-06 15:36 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In a previous release of JBoss EAP 6, logging profiles worked as expected for a servlet, but did not work for a JSP; all log messages from a JSP went to the system log context. This issue presented because the class loader that was checked was `org.apache.jasper.servlet.JasperLoader` with a parent class loader of the class loader that was registered for the log context. This issue has been resolved by adding an option to the log manager to recursively check a class loader's parent for a LogContext.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
smumford: needinfo-


Attachments (Terms of Use)
A maven project with a binary, target/logone.war. (7.29 KB, application/zip)
2013-11-17 21:06 EST, Osamu Nagano
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker LOGMGR-111 Major Resolved ClassLoaderLogContextSelector should optionally include parent CL for context scanning 2018-02-21 08:06 EST
JBoss Issue Tracker WFLY-2524 Major Resolved logging-profile works for a servlet, but doesn't for a JSP 2018-02-21 08:06 EST

  None (edit)
Description Osamu Nagano 2013-11-17 21:05:46 EST
Description of problem:
Suppose the following logging-profile has been set in logging subsystem, and a web app has a proper entry in its MANIFEST.MF (Logging-Profile: logone). Then all messages via "com.example.logone" logger should go into a file, logone.log. It does so with a logger got in a servlet, but it doesn't work a logger got in a JSP.

--
            <logging-profiles>
                <logging-profile name="logone">
                    <file-handler name="logone">
                        <level name="INFO"/>
                        <file relative-to="jboss.server.log.dir" path="logone.log"/>
                    </file-handler>
                    <logger category="com.example.logone">
                        <level name="INFO"/>
                    </logger>
                    <root-logger>
                        <level name="INFO"/>
                        <handlers>
                            <handler name="logone"/>
                        </handlers>
                    </root-logger>
                </logging-profile>
            </logging-profiles>
--


Steps to Reproduce:
1. Set the logging-profile in the description to a standalone instance.
2. Deploy attached web app, logone/target/logone.war.
3. Access a servlet, curl http://localhost:8080/logone/HogeServlet. Its log message appears in standalone/log/logone.log, as expected.
4. Access a JSP, curl http://localhost:8080/logone/index.jsp. Its log message appears in standalone/log/server.log and CONSOLE, unexpectedly.


Actual results:
Log from the servlet goes to standalone/log/logone.log.
Log from the JSP goes to standalone/log/server.log.


Expected results:
Both log messages should go to standalone/log/logone.log.
Comment 1 Osamu Nagano 2013-11-17 21:06:58 EST
Created attachment 825352 [details]
A maven project with a binary, target/logone.war.
Comment 2 JBoss JIRA Server 2013-11-17 21:10:34 EST
Osamu Nagano <onagano@redhat.com> made a comment on jira WFLY-2524

Similar issue, but not sure if it is the same.
Comment 10 James Perkins 2014-02-19 17:36:41 EST
Looks like the issue is the class loader being checked is a org.apache.jasper.servlet.JasperLoader with a parent class loader of the class loader that was registered for the log context. I'm not sure what the fix is going to be ATM. I mainly just wanted to note the cause.
Comment 12 Scott Mumford 2014-07-03 23:57:04 EDT
Hi James.

Could you please review the Doc Text draft I've added. Feel free to make any necessary changes as I had trouble parsing the issue.
Comment 13 Kyle Lape 2014-07-04 12:08:10 EDT
Added a slight clarification to doc text.
Comment 14 James Perkins 2014-07-07 14:29:32 EDT
This looks okay to me.
Comment 17 Nikoleta Ziakova 2014-09-25 10:27:44 EDT
Verified with EAP 6.4.0.DR2.

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