Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1109871

Summary: [RFE] log refactoring
Product: [oVirt] ovirt-engine Reporter: Alon Bar-Lev <alonbl>
Component: RFEsAssignee: Martin Perina <mperina>
Status: CLOSED CURRENTRELEASE QA Contact: Pavol Brilla <pbrilla>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, gklein, iheim, mperina, oourfali, pbrilla, rbalakri, yeylon
Target Milestone: ovirt-3.6.0-rcKeywords: CodeChange, Improvement
Target Release: 3.6.0Flags: rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-3.6.0-0.0.master.20150412172306.git55ba764 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 12:49:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alon Bar-Lev 2014-06-16 14:13:50 UTC
Changes within code we control:

1. as log interface use slf4j wherever possible if linkage is with jboss's slf4j (module), this is slf4j-1.7 interface although it reports 1.6.1 version.

2. for standalone that does not use jboss modules, use commons-logging or slf4j-1.6.1 interface.

3. for standalone as log infrastructure use java.util.logging.

4. drop log4j, commons-logging, org.ovirt.engine.core.utils.log.* from all other places.

Changes within code we do not control:

None.
Examples: jasper, dwh (etl).

Comment 1 Alon Bar-Lev 2014-06-23 10:03:56 UTC
Another finding...

We see ThreadLocal in order to pass the correlation id into our org.ovirt.engine.core.utils.log.*.

This should be modified to use MDC "Mapped Diagnostic Context" instead.

As jboss uses java.util.logging which does not support MDC natively, the we should probably implement/reuse a formatter that is MDC aware, then we can set and clean state in MDC, without any wrapper.

Comment 2 Martin Perina 2014-09-04 11:25:37 UTC
slf4j (even 1.6.1) supports MDC [1], if java.util.logging is used as a backend, slf4j contains adapter to provide it, otherwise slf4j uses backend MDC implementation.

[1] http://www.slf4j.org/apidocs/org/slf4j/MDC.html

Comment 3 Alon Bar-Lev 2014-09-04 11:29:00 UTC
as far as I understand the java.util.logging requires special appenders that are MDC aware (local storage mdc).

Comment 5 Pavol Brilla 2016-01-21 14:19:18 UTC
Verified on 3.6.2.6-0.1.el6, after discussion with mperina