Martin Peřina has posted comments on this change.

Change subject: tools: remove log4j usage from engine-config
......................................................................


Patch Set 1:

>> 1) Add --log-level (default INFO) and --log-file (default console) command 
>> line args
>as we use console to print messages it should be a console appender that 
>always set to info.
>in addition file appender that is controlled by the --log-xxx

Currently we don't use ConsoleAppender at all. So I thought we will use 
ConsoleAppender by default and
if user want to log into file, he can specify --log-file (in this case 
ConsoleAppender would be replaced
with FileAppender). The --log-level would then specify level for currently used 
appender.


>> 2) Remove static log4j config in /etc/ovirt-engine/engine-config/log4j.xml
>I suggest to keep functionality, to allow enable/disable logging of specific 
>components, but make it optional
>and accept it via --log4j-config=?
>You can get the default out of /etc, but better to get the default from 
>embedded resource within jar.

AFAIK, it's hard to mix programmatic and file based configuration in log4j. So 
if you really want to use
--log4j-config args, then it should contain whole config and we will use it as 
is without trying to merge it
with our common configuration.


>> 3) Configure log4j dynamically using above args
>At least the base of root, components to log and console appender are static...
>The dynamic part should only be file appender that is added if --log-file is 
>specified.
>Am I missing something?

Yes, but AFAIK if we want to use dynamic (based on arg value) log4j config, 
it's easier to create
a method which will contain all common configuration and after that add 
specified appender than
have common configuration in file, call Property/DOMConfigurator.configure and 
after that try
to alter it by calling log4j methods.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8cc4eadac817e0527d1286e277b4500f83526c6f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to