logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zak Mc Kracken <zakmc...@yahoo.it>
Subject Overriding properties read from file
Date Mon, 08 Dec 2008 13:58:52 GMT
Hi all,

I am writing a line command tool and I'd like to add an option like
--log-file path that allow to specify where the command execution log is
stored. I want to keep all the other log parameters in a .properties
file, which is loaded from the URL passed via log4j.configuration, as
per Default Initialization Procedure.

This means that I'd like to be able to override one of the properties
loaded from the config file (i.e.: something like
log4j.appender.FileApp.File) with the value passed via the command line
option.

I wonder if something like that is already available in Log4J, or if I
have to implement it on my own. If that is the case, I've written the
attached class, but I am not sure it is the best way to do it.

Thanks in advance for any help.

Marco.





Mime
View raw message