Bug 1109871 - [RFE] log refactoring
Summary: [RFE] log refactoring
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RFEs
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Martin Perina
QA Contact: Pavol Brilla
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-16 14:13 UTC by Alon Bar-Lev
Modified: 2016-02-10 12:49 UTC (History)
8 users (show)

Fixed In Version: ovirt-engine-3.6.0-0.0.master.20150412172306.git55ba764
Clone Of:
Environment:
Last Closed: 2016-02-10 12:49:56 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 32849 0 master MERGED core: Add dependency to original sfl4j library Never
oVirt gerrit 32850 0 master MERGED tools: Replace log4j with slf4j as frontend in engine-manage-domains Never
oVirt gerrit 32851 0 master MERGED tools: Replace oVirt logger with slf4j as frontend in engine-manage-domains Never
oVirt gerrit 32852 0 master MERGED tools: Adds helpers to configure java logging in tools Never
oVirt gerrit 32853 0 master MERGED tools: Replace log4j with JUL as backend for manage-domains Never
oVirt gerrit 33756 0 master MERGED tools: Replace log4j with slf4j as frontend in engine-config Never
oVirt gerrit 33757 0 master MERGED tools: Replace log4j with JUL as backend for engine-config Never
oVirt gerrit 33773 0 master MERGED tools: Replace log4j with slf4j as frontend in notifier Never
oVirt gerrit 33774 0 master MERGED tools: Replace log4j with JUL as backend for notifier Never
oVirt gerrit 33929 0 master MERGED tools: Replace oVirt logger with slf4j as frontend in engine-config Never
oVirt gerrit 34063 0 master MERGED core: Fix dependency issues caused by log refactoring Never
oVirt gerrit 34081 0 master MERGED uutils: remove usage of commons-logging Never
oVirt gerrit 34082 0 master ABANDONED aaa: drop commons-logging Never
oVirt gerrit 34086 0 master MERGED host-deploy: remove usage commons-logging Never
oVirt gerrit 34094 0 master MERGED builtin-extensions: remove usage of org.ovirt.engine.core.utils.log.Log Never
oVirt gerrit 34177 0 master MERGED core: Replace log4j with slf4j in branding Never
oVirt gerrit 34178 0 master MERGED core: Replace log4j with slf4j in docs Never
oVirt gerrit 34179 0 master MERGED core: Replace log4j with slf4j in restapi Never
oVirt gerrit 34180 0 master MERGED core: Replace log4j with slf4j in services Never
oVirt gerrit 34181 0 master MERGED core: Replace log4j with slf4j in utils Never
oVirt gerrit 34182 0 master MERGED frontend: Replace log4j with slf4j Never
oVirt gerrit 34183 0 master MERGED core: Replace log4j with JUL backend in bll tests Never
oVirt gerrit 34184 0 master MERGED core: Replace log4j with JUL backend in dal tests Never
oVirt gerrit 34185 0 master MERGED tools: Replace log4j with JUL backend in tests Never
oVirt gerrit 34186 0 master MERGED core: Remove log4j remains from project Never
oVirt gerrit 34214 0 master MERGED core: drop commons-logging Never
oVirt gerrit 34218 0 master MERGED core: use MDC to hold correlation id Never
oVirt gerrit 34219 0 master MERGED core: Replace oVirt logger with slf4j in aaa Never
oVirt gerrit 34244 0 master MERGED host-deploy: remove utils.log usage Never
oVirt gerrit 34264 0 master MERGED core: Replace oVirt logger with slf4j in utils Never
oVirt gerrit 34273 0 master MERGED core: Replace oVirt logger with slf4j in dal Never
oVirt gerrit 34290 0 master MERGED restapi: Replace oVirt logger with slf4j Never
oVirt gerrit 34295 0 master MERGED core: migrate the LoggedUtils into slf4j Never
oVirt gerrit 34296 0 master MERGED services: drop ovirt logger Never
oVirt gerrit 34323 0 master MERGED core: Replace oVirt logger with slf4j in bll/gluster Never
oVirt gerrit 34324 0 master MERGED core: Replace oVirt logger with slf4j in bll/job Never
oVirt gerrit 34325 0 master MERGED core: Replace oVirt logger with slf4j in bll/XXX Never
oVirt gerrit 34344 0 master MERGED core: Replace oVirt logger with slf4j in bll/network Never
oVirt gerrit 34359 0 master MERGED core: Replace oVirt logger with slf4j in bll Never
oVirt gerrit 34374 0 master MERGED core: remove ovirt logger from vdsbroker and friends Never
oVirt gerrit 34668 0 master MERGED core: Remove usage of ExceptionUtils.getMessage Never
oVirt gerrit 35042 0 master MERGED core: Remove unnecessary String.format in logging calls Never
oVirt gerrit 36654 0 master MERGED packaging: remove unused log4j.xml Never

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


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