Martin Peřina has posted comments on this change.

Change subject: tools: Adds helpers to configure java logging in tools
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.ovirt.org/#/c/32852/5/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/log/JavaLoggingUtils.java
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/log/JavaLoggingUtils.java:

Line 12:     /**
Line 13:      * Instance of org.ovirt logger. We need to keep instance of it to 
prevent OpenJDK incompatibility described at
Line 14:      * 
http://findbugs.sourceforge.net/bugDescriptions.html#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE
Line 15:      */
Line 16:     private static Logger ovirtLogger;
> why can't we get it every time? or ignore the warning? or here do get logge
I just verified with sample provided on findbugs site, that without keeping 
reference to Logger which is configured ("org.ovirt"), the configuration is 
lost, when GC is executed (OpenJDK 1.7).

Also logger per class is initialized as Logger.getLogger(className) so we can 
keep track who is logging. "org.ovirt" is parent of all those loggers and it 
forwards logging messages to defined handler(s).

The only other option is to configure root logger, but then log file will 
contain logging messages also from other packages (for example if level set to 
debug we can see also debug logs from standard library).

So IMHO this is the best solution.
Line 17: 
Line 18:     /**
Line 19:      * Parses logging level from case insensitive string. Level name 
can be specified in log4j or java.util.logging
Line 20:      * format:


-- 
To view, visit http://gerrit.ovirt.org/32852
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie1c46ca552888b347a4ff810003e0fcc818f832f
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to