Alon Bar-Lev has posted comments on this change.

Change subject: core: Add common methods for runtime log4j setup
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.ovirt.org/#/c/26588/1/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/log/Log4jUtils.java
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/log/Log4jUtils.java:

Line 28:      */
Line 29:     public static void setupLogging(String log4jConfig, URL 
defaultUrl) {
Line 30:         try {
Line 31:             URL url = defaultUrl;
Line 32:             if (!StringUtils.isBlank(log4jConfig)) {
> isEmpty?
also, I am unsure why null is not the missing value for all usages in this 
class.
Line 33:                 File f = new File(log4jConfig);
Line 34:                 if (f.exists()) {
Line 35:                     url = f.toURI().toURL();
Line 36:                 } else {


Line 77:             Logger rootLogger = Logger.getRootLogger();
Line 78:             if (rootLogger.getLevel() == Level.OFF) {
Line 79:                 // by default it's set to OFF, so we need to enabled 
it before adding appender
Line 80:                 rootLogger.setLevel(Level.ALL);
Line 81:             }
> if it is off, it means the user wants it off, we do not touch it.
ok, I understand... this  is for you to have isDebugEnabled() set by log level. 
if that's the case, you should not put it here either, but when you set the log 
level at main, set the log level for your logger as well.

you can have a method in this file that accepts level and list of strings 
(logs), and sett all these to that level if level is non null.
Line 82:             rootLogger.addAppender(fa);
Line 83:         }
Line 84:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic00ea0af643e8c978fd67eb8c56e2329d43e776d
Gerrit-PatchSet: 1
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: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@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