Changeset 459

Show
Ignore:
Timestamp:
01/18/02 15:25:49
Author:
miyagawa
Message:

0.11_02

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Log-Dispatch-Config/trunk/MANIFEST

    r454 r459  
    44README 
    55lib/Log/Dispatch/Config.pm 
    6 lib/Log/Dispatch/Config/Category.pm 
    76lib/Log/Dispatch/Configurator.pm 
    87lib/Log/Dispatch/Configurator/AppConfig.pm 
     
    1817t/09_ini.t 
    1918t/10_caller.t 
    20 t/11_category.t 
    21 t/12_cat_watch.t 
    2219t/another.cfg 
    2320t/date.cfg 
  • Log-Dispatch-Config/trunk/README

    r455 r459  
    148148    See GoF Design Pattern book for Singleton Pattern. 
    149149 
    150     But in practice, in persistent environment like mod_perl, Singleton 
    151     instance becomes sometimes messy. If you call "configure_and_watch" 
    152     method on Log::Dispatch::Config instead of "configure", "instance" call 
    153     will reload the singleton object when configuration file is modified 
    154     since its last configuration time. 
     150    But in practice, in persistent environment like mod_perl, lifetime of 
     151    Singleton instance becomes sometimes messy. If you want to reload 
     152    singleton object manually, call "reload" method. 
     153 
     154      Log::Dispatch::Config->reload; 
     155 
     156    And, if you want to reload object on the fly, as you edit "log.conf" or 
     157    something like that, what you should do is to call "configure_and_watch" 
     158    method on Log::Dispatch::Config instead of "configure". Then "instance" 
     159    call will check mtime of configuration file, and compares it with last 
     160    configuration time. If config file is newer than last configuration, it 
     161    will automatically reload object. 
     162 
     163NAMESPACE COLLISION 
     164    If you use Log::Dispatch::Config in multiple projects on the same perl 
     165    interpreter (like mod_perl), namespace collision would be a problem. 
     166    Bizzare thing will happen when you call 
     167    "Log::Dispatch::Config->configure" multiple times with differenct 
     168    argument. 
     169 
     170    In such cases, what you should do is to define your own logger class. 
     171 
     172      package My::Logger; 
     173      use Log::Dispatch::Config; 
     174      use base qw(Log::Dispatch::Config); 
     175 
     176    Or make wrapper for it. See the POE::Component::Logger manpage 
     177    implementation by Matt. 
    155178 
    156179PLUGGABLE CONFIGURATOR 
     
    279302 
    280303SEE ALSO 
    281     the Log::Dispatch::Config::Category manpage, the 
    282     Log::Dispatch::Configurator::AppConfig manpage, the Log::Dispatch 
     304    the Log::Dispatch::Configurator::AppConfig manpage, the Log::Dispatch 
    283305    manpage, the AppConfig manpage, the POE::Component::Logger manpage 
    284306 
  • Log-Dispatch-Config/trunk/lib/Log/Dispatch/Config.pm

    r455 r459  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.11_01
     5$VERSION = 0.11_02
    66 
    77use Log::Dispatch; 
     
    363363See GoF Design Pattern book for Singleton Pattern. 
    364364 
    365 But in practice, in persistent environment like mod_perl, Singleton 
    366 instance becomes sometimes messy. If you call C<configure_and_watch> 
    367 method on Log::Dispatch::Config instead of C<configure>, C<instance> 
    368 call will reload the singleton object when configuration file is 
    369 modified since its last configuration time. 
     365But in practice, in persistent environment like mod_perl, lifetime of 
     366Singleton instance becomes sometimes messy. If you want to reload 
     367singleton object manually, call C<reload> method. 
     368 
     369  Log::Dispatch::Config->reload; 
     370 
     371And, if you want to reload object on the fly, as you edit C<log.conf> 
     372or something like that, what you should do is to call 
     373C<configure_and_watch> method on Log::Dispatch::Config instead of 
     374C<configure>. Then C<instance> call will check mtime of configuration 
     375file, and compares it with last configuration time. If config file is 
     376newer than last configuration, it will automatically reload object. 
     377 
     378=head1 NAMESPACE COLLISION 
     379 
     380If you use Log::Dispatch::Config in multiple projects on the same perl 
     381interpreter (like mod_perl), namespace collision would be a 
     382problem. Bizzare thing will happen when you call 
     383C<Log::Dispatch::Config-E<gt>configure> multiple times with differenct 
     384argument. 
     385 
     386In such cases, what you should do is to define your own logger class. 
     387 
     388  package My::Logger; 
     389  use Log::Dispatch::Config; 
     390  use base qw(Log::Dispatch::Config); 
     391 
     392Or make wrapper for it. See L<POE::Component::Logger> implementation 
     393by Matt. 
    370394 
    371395=head1 PLUGGABLE CONFIGURATOR 
     
    508532=head1 SEE ALSO 
    509533 
    510 L<Log::Dispatch::Config::Category>, 
    511534L<Log::Dispatch::Configurator::AppConfig>, L<Log::Dispatch>, 
    512535L<AppConfig>, L<POE::Component::Logger> 
  • Log-Dispatch-Config/trunk/lib/Log/Dispatch/Configurator.pm

    r455 r459  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.11_01
     5$VERSION = 0.11_02
    66 
    77sub new { 
  • Log-Dispatch-Config/trunk/lib/Log/Dispatch/Configurator/AppConfig.pm

    r455 r459  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.11_01
     5$VERSION = 0.11_02
    66 
    77use Log::Dispatch::Configurator;