Martin Peřina has posted comments on this change.

Change subject: tools: Replaces log4j with JUL as backend for manage-domains
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.ovirt.org/#/c/32853/3/backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/tools/ManageDomainsExecutor.java
File 
backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/tools/ManageDomainsExecutor.java:

Line 28: 
Line 29:     public static void setupCustomLogging(String configFile, String 
logFile, String logLevel) {
Line 30:         if (configFile != null) {
Line 31:             try (InputStream is = new FileInputStream(configFile)) {
Line 32:                 JavaLoggingUtils.setupLogging(is);
> I thought of having default embedded property file or user provided file, a
So we can have /etc/ovirt-engine/engine-manage-domains/logging.properties which 
will be passed by default to JVM in -Djava.util.logging.config.file property in 
engine-manage-domains.sh

By default logging will be turned on. If user want to enable logging, he will 
need to set desired logging level and logging file in above mentioned 
properties. Using this we don't need any Java code to setup logging and we 
could remove --log* command line parameters from tools.

Is this what you ment by your comment?
Line 33:             } catch (IOException ex) {
Line 34:                 throw new IllegalArgumentException(
Line 35:                         String.format("Error loading loggging 
configuration from '%s': %s", configFile, ex.getMessage()),
Line 36:                         ex);


http://gerrit.ovirt.org/#/c/32853/3/backend/manager/modules/builtin-extensions/src/main/resources/engine-manage-domains/logging.properties
File 
backend/manager/modules/builtin-extensions/src/main/resources/engine-manage-domains/logging.properties:

Line 6: # To change logging properties for engine-manage-domains user command 
line
Line 7: # options --log-file, --log-level and --log-config
Line 8: 
Line 9: # Set root level to ALL, so it can be changed per handler using command 
line parameter --log-level
Line 10: .level=ALL
> but why?
I know what's wrong. I set log level only to handler, but not to the 
"org.ovirt" logger, so it was inherited from .level property.

I just verified that if level is set for "org.ovirt" logger, it doesn't matter 
what is set in .level and for handler we don't need to set any level (if 
handler level is not set, then it will log everything it gets from logger).
Line 11: 
Line 12: # Default format of log line is: DATE TIME LEVEL [SOURCE] Message 
Stacktrace


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I16afc336c26615978392f7d4ff911bf646c42df6
Gerrit-PatchSet: 3
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