When I posted the message reproduced below I managed to append a botched
version of my patch. Here is a good one (demo.tgz was okay, reposting for
completeness).  Sorry about that.

Attachment: log4perl_combo.patch
Description: Binary data

Attachment: demo.tgz
Description: Binary data



Anno


On 03.10.2008, at 12:19, Anno Siegel wrote:

I'd like to add the ability to give multiple (partial) configuration
files to init() and init_and_watch(). In place of a single file, you
could specify an array(ref) of files, whose concatenation is used in
initialization, and which are all watched for changes.

A user might say

    init_and_watch([
        'my_std_root.conf',      # almost everything might use that
        'my_application.conf',   # special to this application
'that_module.conf', # came with That::Module, which i'm using
    ], 'HUP');

to invoke a few components. Editing or replacing any of them would be
noticed by the application (after a HUP). I believe that such a feature
would help in managing configuration files.

The appended patch adds the feature to Log4perl, in a yet somewhat
sketchy way.  I'd like to hear opinions whether this would be a useful
addition and if it has a chance of being accepted. If I'm on the wrong
trip and everything speaks for monolithic configuration files, please
say so.

Here are some technicalities about the patch, of interest if you
intend to try this at home :)

It's against v 1.18 from CPAN and can be applied from inside a fresh
build dir as "patch -p0 <log4perl_combo.patch".  It addds, under
lib/, the module Log/Log4perl/Config/Combo.pm, and it modifies
.../Config.pm and .../Watch.pm to understand the additional form
of file specification.  "prove -Ilib t/" should show that the
changes are compatible with the current behavior.

To see the new behavior, unpack demo.tgz in the build dir (won't
work anywhere else) and cd into demo.  Inspect "runme", then run it
as "perl runme", in case the shebang doesn't work.  runme configures
l4p from the two files root.conf and one.conf and then produces sample
log events on demand. It takes an optional argument, the time or
signal to pass to init_and_watch(). The idea is to use another
shell to edit and/or replace the configuration files, then see if
the changes are honored. The directory reset_conf contains the
original configuration files again.

Regards, Anno
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to