You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Matthias Fahrni <ma...@gmx.net> on 2001/08/31 09:48:40 UTC

mixed logfilename configuration

hi
we would like to use the log4j log facility, because we think it's a 
great tool.

in our projects we have to use a machine wide config file, where all 
machine depending properties are defined in a single file. this is for 
example the applications log file location (k:\apps\logs\).

therefor we need to get the path information for the logfile from our 
configuration file and can't define it in the log4j configuration file (we 
are not allowed to do that and we can't use relative names, 
because we work in windows environment and the log files can be 
located on another drive). but the second part of the logfile name, 
we would like to define in the log4j configuration file, because of its 
great flexibility.

i have done some experiments with "mixed" configuration 
(configuration file and programmatically setting/overwriting the 
logfile name) but they all failed because i wasn't able to change the 
values from the configuration file i.e. the new values were ignored.

in short: we need to set (a part of) the logfile path from within our 
application (that reads it from the application config) and want to 
set the logfile name from the log4j configuration file.

example for a logfile name:
d:\apps\logs\myapplication\database\logfile.log
in this absolute filename the part "d:\apps\logs\" is from the 
configuration file from the application and the part 
"myapplication\datadbase\logfile.log" is from the log4j configuration 
file.

has anybody an idea how this problem can be solved? is there 
already a possibility to do that? 
we thought about extending the FileAppender class or 
implementing the AppenderAttachable interface to satisfy our 
needs.

matthias





---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org