Bug 1164063 - Cannot distribute log files when using commons-logging with Logging-Profile
Summary: Cannot distribute log files when using commons-logging with Logging-Profile
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging
Version: 6.3.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: James Perkins
QA Contact: Nikoleta Hlavickova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-14 03:05 UTC by Eiichi Nagai
Modified: 2018-12-09 19:10 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-11-25 20:02:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFCORE-254 0 Minor Resolved logging-profiles doesn't work with Apache Common Logging 2018-01-11 11:51:12 UTC

Description Eiichi Nagai 2014-11-14 03:05:12 UTC
Created attachment 957401 [details]
reproducer

Description of problem:
Even if Logging-Profile was set in META-INF, log messages are not distributed to each log file when it is using same category name.

Version-Release number of selected component (if applicable):
EAP 6.3.2

How reproducible:
Uploaded sample.zip as reproducer.

Steps to Reproduce:
1. Create new EAP 6 environment.
2. Unzip the sample.zip
  - Replace standalone.xml
  - Deploy TestLogEAR.ear
3. Run EAP 6 server.
4. Access using following URL.
 - http://localhost:8080/TestLogWeb1/TestServlet1
 - http://localhost:8080/TestLogWeb2/TestServlet1
5. Confirm log directory.

Actual results:
test1.log is for TestLogWeb1. test2.log is for TestLogWeb2. However, test1.log is contained from message of TestLogWeb2.

Comment 1 James Perkins 2014-11-25 20:01:02 UTC
The issue is again with jcl-over-slf4j. At this point we might need to fork it.

jcl-over-slf4j uses a static instance and a map to find the logger. Because of this a logger with the same name will return the first logger created no matter which log context it was created on.

For a workaround you should be able exclude org.apache.commons.logging with a jboss-deployment-structure.xml and include a jcl-over-slfj4 library in each WAR deployment.

Note this issue will only appear if loggers with the same name are desired on deployments that use a new log context. For example per-deployment logging that uses commons-logging or logging-profiles that use commons-logging.


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