Alon Bar-Lev has posted comments on this change.

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


Patch Set 5:

(3 comments)

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

> This requires to be in bootclasspath, because:
I still think you should not touch this.... and use whatever java provides.
Line 1: package org.ovirt.engine.core.utils.log;
Line 2: 
Line 3: import java.io.PrintWriter;
Line 4: import java.io.StringWriter;


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;
> If we are not storing instance of "org.ovirt" logger, then findbugs raises 
why can't we get it every time? or ignore the warning? or here do get logger?

the logger library within already has singleton.
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:


Line 92:      */
Line 93:     public static void addFileHandler(String fileName, String 
levelName) {
Line 94:         try {
Line 95:             FileHandler fh = new FileHandler(fileName);
Line 96:             fh.setFormatter(new JavaLoggingFormatter());
> I will try, but I'm almost sure you canned define a file handler without a 
the default handler should be console handler.
Line 97:             getOvirtLogger().addHandler(fh);
Line 98:             getOvirtLogger().setLevel(parseLevel(levelName));
Line 99:         } catch (SecurityException | IOException ex) {
Line 100:             throw new IllegalArgumentException(


-- 
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