You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(38) |
Sep
(126) |
Oct
(23) |
Nov
(72) |
Dec
(36) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(76) |
Feb
(32) |
Mar
(19) |
Apr
(6) |
May
(54) |
Jun
(40) |
Jul
(45) |
Aug
(35) |
Sep
(51) |
Oct
(67) |
Nov
(10) |
Dec
(50) |
2004 |
Jan
(51) |
Feb
(22) |
Mar
(22) |
Apr
(28) |
May
(53) |
Jun
(99) |
Jul
(38) |
Aug
(49) |
Sep
(23) |
Oct
(29) |
Nov
(30) |
Dec
(48) |
2005 |
Jan
(15) |
Feb
(21) |
Mar
(25) |
Apr
(16) |
May
(131) |
Jun
|
Jul
(8) |
Aug
(5) |
Sep
(15) |
Oct
|
Nov
(15) |
Dec
(12) |
2006 |
Jan
(15) |
Feb
(20) |
Mar
(8) |
Apr
(10) |
May
(3) |
Jun
(16) |
Jul
(15) |
Aug
(11) |
Sep
(17) |
Oct
(27) |
Nov
(11) |
Dec
(12) |
2007 |
Jan
(19) |
Feb
(18) |
Mar
(33) |
Apr
(4) |
May
(15) |
Jun
(22) |
Jul
(19) |
Aug
(20) |
Sep
(14) |
Oct
(4) |
Nov
(34) |
Dec
(11) |
2008 |
Jan
(8) |
Feb
(18) |
Mar
(2) |
Apr
(4) |
May
(26) |
Jun
(9) |
Jul
(8) |
Aug
(8) |
Sep
(3) |
Oct
(17) |
Nov
(14) |
Dec
(4) |
2009 |
Jan
(6) |
Feb
(41) |
Mar
(21) |
Apr
(10) |
May
(21) |
Jun
|
Jul
(8) |
Aug
(4) |
Sep
(3) |
Oct
(8) |
Nov
(6) |
Dec
(5) |
2010 |
Jan
(14) |
Feb
(13) |
Mar
(7) |
Apr
(12) |
May
(4) |
Jun
(1) |
Jul
(11) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(10) |
Dec
|
2011 |
Jan
(7) |
Feb
(3) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(1) |
Jul
(6) |
Aug
(6) |
Sep
(10) |
Oct
(5) |
Nov
(4) |
Dec
(5) |
2012 |
Jan
(4) |
Feb
(5) |
Mar
(1) |
Apr
(7) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(5) |
Oct
(5) |
Nov
(4) |
Dec
(5) |
2013 |
Jan
(6) |
Feb
|
Mar
(14) |
Apr
(9) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(4) |
Dec
(6) |
2014 |
Jan
|
Feb
(1) |
Mar
(10) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
(4) |
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Mathieu L. <mrd...@ya...> - 2002-09-24 04:05:31
|
--- msc...@ao... wrote: > Funny, a couple of weeks ago I had exactly that in there. > However, there was some resistance on log4perl-devel > (Kevin!!!:) arguing that we need to educate people to > explicitely state the category (which could be very > different from the package name BTW). Hum. Sure. Programmers tend to be lazy, if they have to go through this trouble to write logging calls, you end up with no logging... And then, what do you turn on to debug your system at runtime? You still have the option of changing the category name. Maybe you could do it at the use level: use Log::Log4perl::EZ +MyOwnCategory; (Note that I'm not positive how to implement this, I'm just throwing the suggestion). > my $logger = get_logger("Blah::Poo"); > $logger->debug("Something happened!!!"); > # ... > $logger->debug("Something else!!!"); > > which just obtains the logger instance once. Which could > have a significant impact if there are 20 debug > statements within one function. A quick glance at the code, and me think one could cache the logger objects without trouble (unless they are much bigger than I think). So get_logger would become: sub get_logger() { ... my $category = $_[0]; return $loggers{$category} if exists $loggers{$category}; return $loggers{$category} = Log::Log4perl::Logger->get_logger($category); } What do you think? -Mathieu __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com |
From: <msc...@ao...> - 2002-09-24 03:16:02
|
In a message dated Mon, 23 Sep 2002 8:59:31 PM Eastern Standard Time, mrd...@ya... writes: >Couldn't the interface be simpler? > use Log::Log4perl::EZ; > ... > DEBUG("New food: $what"); # Or Debug() or debug() Funny, a couple of weeks ago I had exactly that in there. However, there was some resistance on log4perl-devel (Kevin!!!:) arguing that we need to educate people to explicitely state the category (which could be very different from the package name BTW). The other argument against the 'EZ' interface was that something like DEBUG("Something happened!!!"); # ... DEBUG("Something else!!!"); needs to call get_logger() twice behind the scenes, which is un peu slower than my $logger = get_logger("Blah::Poo"); $logger->debug("Something happened!!!"); # ... $logger->debug("Something else!!!"); which just obtains the logger instance once. Which could have a significant impact if there are 20 debug statements within one function. I guess there's always a tradeoff -- but if one more person asks for it, I'll hammer it in, you've been warned :). -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: Mathieu L. <mrd...@ya...> - 2002-09-24 01:59:34
|
Couldn't the interface be simpler? In order to write one line of log, here is what I need to do: package Groceries::Food; use Log::Log4perl qw(get_logger); ... my $logger = get_logger("Groceries::Food"); ... $logger->debug("New food: $what"); Shouldn't I just be allowed to do something like this: package Groceries::Food; use Log::Log4perl::EZ; ... DEBUG("New food: $what"); # Or Debug() or debug() In which case, the argument to get_logger() is guessed to be the name of the current package. I like the philosophy of the package, but calling get_logger in every single functions that logs is just a waste. -Mathieu __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com |
From: Kevin G. <ke...@go...> - 2002-09-24 00:10:52
|
I just built a 5.8 (not 5.6.1) with threads and Log4perl tested fine, I'll do more investigation and let you know. Mike Schilli wrote: > Looks like while Log::Dispatch works fine under Windows, we don't: > > http://archive.develooper.com/cpa...@pe.../msg10245.html > > It says they're using multi-threaded Windows and I'm positive there's probs with Log::Log4perl if > several threads start cranking away in parallel, but I doubt that the test suite could impose > multi-threaded challenges on Log::Log4perl. Seems like there's a more general problem with Log4perl > and Windows. > > Anybody with a Perl-and-nmake-enabled Windows installation willing to look into it :) ? > > -- Mike > -------------------------------------------------------- > Mike Schilli log...@pe... http://perlmeister.com > -------------------------------------------------------- > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: <Msc...@ao...> - 2002-09-23 17:08:45
|
In a message dated 9/23/02 9:55:48 AM Pacific Daylight Time, ke...@go... writes: > Diff is below, already checked in, all tests pass, that ok with > you? > Ah, much better, thanks! -- Mike Mike Schilli log...@pe... http://perlmeister.com http://log4perl.sourceforge.net |
From: Kevin G. <ke...@go...> - 2002-09-23 16:55:37
|
> I've removed all but one instance of POPULATION[x] > in the test cases, t/027Watch.t seems to need access to the latest > created appender, so I left that > one in. Kevin, can you please double-check? Reloading the config file pushed a new appender into @POPULATION with the same name as the old one, so I changed @POPULATION to a hash so we can do lookups by name, which seemed to be where you were going with it anyway. Diff is below, already checked in, all tests pass, that ok with you? =================================================================== RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl/TestBuffer.pm,v retrieving revision 1.3 diff -u -r1.3 TestBuffer.pm --- modules/TestBuffer.pm 22 Sep 2002 18:37:17 -0000 1.3 +++ modules/TestBuffer.pm 23 Sep 2002 16:43:16 -0000 @@ -10,17 +10,7 @@ use base qw( Log::Dispatch::Output ); use fields qw( stderr ); - # This is a dirty trick for testing: Keep track - # of the entire object population. So we'll - # be able to access the buffers even if the - # objects are created behind our back -- as - # long as we remember the order in which - # they've been created: - # $Log::Log4perl::TestBuffer::POPULATION[0] is - # the first one etc. - # The DESTROY method below cleans up afterwards. - -our @POPULATION = (); +our %POPULATION = (); ################################################## sub new { @@ -35,7 +25,7 @@ $self->{stderr} = exists $params{stderr} ? $params{stderr} : 1; $self->{buffer} = ""; - push @POPULATION, $self; + $POPULATION{$self->name} = $self; return $self; } @@ -66,7 +56,7 @@ ################################################## my($self) = @_; - @POPULATION = (); + %POPULATION = (); $self->{buffer} = ""; } @@ -77,7 +67,7 @@ return unless defined $self; - @POPULATION = grep { defined $_ && $_ != $self } @POPULATION; + delete $POPULATION{$self->name}; } ################################################## @@ -92,12 +82,8 @@ die "No name given" unless defined $name; - for my $appender (@POPULATION) { - if($appender->name() eq $name) { - return $appender; - } - } - return undef; + return $POPULATION{$name}; + } Mike Schilli wrote: > Hi all, > > just found out that with the latest perl 5.8.0, one of the test cases utilizing POPULATION[x] failed > because it was relying on the order of hash keys when creating the appenders via a conf file. Fixed > that by introducing a by_name() method for Log::Log4perl::TestBuffer which lets you retrieve a > TestBuffer by name (like "A1" in a config file). I've removed all but one instance of POPULATION[x] > in the test cases, t/027Watch.t seems to need access to the latest created appender, so I left that > one in. Kevin, can you please double-check? > > Everything else looks good, I guess we can release 0.24 soon. Changes so far: > > * (kg) Fix for init_and_watch and test cases > * (ms) Added documentation for Log::Log4perl::Config > * (ms) Added log4perl.additivity.loggerName conf file syntax > * (ms) Assume Log::Log4perl::Layout prefix of 'relative' > layout class names in conf file (say 'SimpleLayout' > instead of 'Log::Log4perl::Layout::SimpleLayout'). > * (ms) accidently appending a ';' at the end of an appender > class in a conf file now spits out a reasonable error message > * (ms) added a by_name() method to TestBuffer to retrieve an > instance of the TestBuffer population by name instead of > relying on the order of creation via POPULATION[x] > (for testing only). > > Any comments/problems, please let me know. > > -- Mike > -------------------------------------------------------- > Mike Schilli log...@pe... http://perlmeister.com > -------------------------------------------------------- > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Mike S. <m...@pe...> - 2002-09-23 03:53:03
|
Looks like while Log::Dispatch works fine under Windows, we don't: http://archive.develooper.com/cpa...@pe.../msg10245.html It says they're using multi-threaded Windows and I'm positive there's probs with Log::Log4perl if several threads start cranking away in parallel, but I doubt that the test suite could impose multi-threaded challenges on Log::Log4perl. Seems like there's a more general problem with Log4perl and Windows. Anybody with a Perl-and-nmake-enabled Windows installation willing to look into it :) ? -- Mike -------------------------------------------------------- Mike Schilli log...@pe... http://perlmeister.com -------------------------------------------------------- |
From: Mike S. <m...@pe...> - 2002-09-22 18:46:16
|
Hi all, just found out that with the latest perl 5.8.0, one of the test cases utilizing POPULATION[x] failed because it was relying on the order of hash keys when creating the appenders via a conf file. Fixed that by introducing a by_name() method for Log::Log4perl::TestBuffer which lets you retrieve a TestBuffer by name (like "A1" in a config file). I've removed all but one instance of POPULATION[x] in the test cases, t/027Watch.t seems to need access to the latest created appender, so I left that one in. Kevin, can you please double-check? Everything else looks good, I guess we can release 0.24 soon. Changes so far: * (kg) Fix for init_and_watch and test cases * (ms) Added documentation for Log::Log4perl::Config * (ms) Added log4perl.additivity.loggerName conf file syntax * (ms) Assume Log::Log4perl::Layout prefix of 'relative' layout class names in conf file (say 'SimpleLayout' instead of 'Log::Log4perl::Layout::SimpleLayout'). * (ms) accidently appending a ';' at the end of an appender class in a conf file now spits out a reasonable error message * (ms) added a by_name() method to TestBuffer to retrieve an instance of the TestBuffer population by name instead of relying on the order of creation via POPULATION[x] (for testing only). Any comments/problems, please let me know. -- Mike -------------------------------------------------------- Mike Schilli log...@pe... http://perlmeister.com -------------------------------------------------------- |
From: Kevin G. <ke...@go...> - 2002-09-20 18:51:25
|
The worst that can happen is that if a user has the watch delay set to N, not more than 1 log statement every N will not be logged. If watch delay is set to 60 minutes and they issue a log message every minute, after 120 minutes they'll only have 118 statements in their log file. I checked in changes to 017Watch.t to demonstrate it, here's what the change looks like: RCS file: /cvsroot/log4perl/Log-Log4perl/t/017Watch.t,v retrieving revision 1.2 diff -u -r1.2 017Watch.t --- t/017Watch.t 3 Aug 2002 19:22:18 -0000 1.2 +++ t/017Watch.t 20 Sep 2002 18:44:31 -0000 @@ -61,13 +61,16 @@ $logger->debug('2nd debug message'); $logger->info('2nd info message'); +print "sleeping for 3 secs\n"; +sleep 3; +$logger->info('2nd info message again'); open (LOG, $testfile) or die "can't open $testfile $!"; my @log = <LOG>; close LOG; my $log = join('',@log); -ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\n"); +ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\nINFO animal.dog N/A - 2nd info message again\n"); # *************************************************************** # do it 3rd time @@ -98,7 +101,7 @@ close LOG; $log = join('',@log); -ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\nINFO - 3rd info message\n"); +ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\nINFO animal.dog N/A - 2nd info message again\nINFO - 3rd info message\n"); BEGIN {plan tests => 2}; Msc...@ao... wrote: > In a message dated 9/19/02 12:13:06 PM Pacific Daylight Time, > ke...@go... writes: > > >> We should release, since the bug >> statements not to log if they occur when a stat of the config file is >> due. > > > > What's the worst that could happen with the previous release? I remember > I ran a couple of very rudimentary tests and they worked. Also, could > you please add a bunch of test cases that fail in the old case and > succeed with the new code? > > -- Mike > > Mike Schilli > log...@pe... > http://perlmeister.com > http://log4perl.sourceforge.net -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: <Msc...@ao...> - 2002-09-20 02:48:02
|
In a message dated 9/19/02 12:13:06 PM Pacific Daylight Time, ke...@go... writes: > We should release, since the bug > statements not to log if they occur when a stat of the config file is due. > What's the worst that could happen with the previous release? I remember I ran a couple of very rudimentary tests and they worked. Also, could you please add a bunch of test cases that fail in the old case and succeed with the new code? -- Mike Mike Schilli log...@pe... http://perlmeister.com http://log4perl.sourceforge.net |
From: Kevin G. <ke...@go...> - 2002-09-19 19:12:56
|
Ack! Still didn't get it right. When we split the conditional into two pieces, the return statement ended up in the wrong block. I just checked in the change to cvs. We should release, since the bug statements not to log if they occur when a stat of the config file is due. sub generate_watch_code { return <<'EOL'; print "exe_watch_code:\n" if DEBUG; # more closures here if ( ($LAST_CHECKED_AT + $WATCH_DELAY) < time()){ $LAST_CHECKED_AT = time(); print " Checking $FILE_TO_WATCH for changes ...\n" if DEBUG; if ($LAST_CHANGED_AT < (stat($FILE_TO_WATCH))[9] ){ $LAST_CHANGED_AT = (stat(_))[9]; print " Config file has been modified\n" if DEBUG; Log::Log4perl->init_and_watch($FILE_TO_WATCH, $WATCH_DELAY); my $methodname = lc($level); $logger->$methodname($message); # send the message # to the new configuration return; #and return, we're done with this incarnation } #return; Not here, fool! You haven't logged anything yet! } EOL -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-09-19 00:09:08
|
It's almost certainly a routing/DNS/email problem with that machine, you'll have to track that down on your end. If you're having trouble running the debugger with Log4perl, try using Log::Dispatch by itself. Jose Vicente Nunez Zuleta wrote: > Is really bizarre... i tested the code on another machine and it works. But if i use your code in the same machine then no email is sent. > > At least i known that the "server" property works :) > > I went and run a small program i have that uses Net::SMTP directly and this is what i got (the email is sent): > > Net::SMTP: Net::SMTP(2.15) > Net::SMTP: Net::Cmd(2.18) > Net::SMTP: Exporter(5.562) > Net::SMTP: IO::Socket::INET(1.25) > Net::SMTP: IO::Socket(1.26) > Net::SMTP: IO::Handle(1.21) > > Net::SMTP=GLOB(0x103244)<<< 220 ZZZZ ESMTP Sendmail WWW/WWW; Wed, 18 Sep 2002 18:08:38 -0400 > Net::SMTP=GLOB(0x103244)>>> EHLO YYYY > Net::SMTP=GLOB(0x103244)<<< 250-ZZZZZ Hello sol0001.ZZZZZ [XX.XX.XX.XX], pleased to meet you > Net::SMTP=GLOB(0x103244)<<< 250-ENHANCEDSTATUSCODES > Net::SMTP=GLOB(0x103244)<<< 250-8BITMIME > Net::SMTP=GLOB(0x103244)<<< 250-SIZE > Net::SMTP=GLOB(0x103244)<<< 250-DSN > Net::SMTP=GLOB(0x103244)<<< 250-ONEX > Net::SMTP=GLOB(0x103244)<<< 250-ETRN > Net::SMTP=GLOB(0x103244)<<< 250-XUSR > Net::SMTP=GLOB(0x103244)<<< 250 HELP > Net::SMTP=GLOB(0x103244)>>> MAIL FROM:<KKKKK> > Net::SMTP=GLOB(0x103244)<<< 250 2.1.0 <KKKKK>... Sender ok > Net::SMTP=GLOB(0x103244)>>> RCPT TO:<KKKKK> > Net::SMTP=GLOB(0x103244)<<< 250 2.1.5 <KKKK>... Recipient ok > Net::SMTP=GLOB(0x103244)>>> DATA > Net::SMTP=GLOB(0x103244)<<< 354 Enter mail, end with "." on a line by itself > Net::SMTP=GLOB(0x103244)>>> To: KKKK > Net::SMTP=GLOB(0x103244)>>> Subject: Testing mail program > Net::SMTP=GLOB(0x103244)>>> > Net::SMTP=GLOB(0x103244)>>> This is a test message > > Net::SMTP=GLOB(0x103244)>>> . > Net::SMTP=GLOB(0x103244)<<< 250 2.0.0 g8IM8cu32649 Message accepted for delivery > Net::SMTP=GLOB(0x103244)>>> QUIT > Net::SMTP=GLOB(0x103244)<<< 221 2.0.0 ZZZZZ closing connection > > I'm clueless here. There is a way i can activate the Debug option from the logger so i can see whats going on? > > Thanks in advance. > > JV. > > On Wed, 18 Sep 2002 14:53:24 -0700 > Kevin Goess <ke...@go...> wrote: > > >>Jose, this works for me, I get an email just fine, note that mail.server >>should be your outgoing smtp server, right? >> >>--------------------------------------------- >>use Log::Log4perl; >> >>Log::Log4perl->init(\' >>log4perl.logger.Veronicad=DEBUG, screen, mail >>log4perl.appender.screen=Log::Dispatch::Screen >>log4perl.appender.screen.stderr=0 >>log4perl.appender.screen.layout=Log::Log4perl::Layout::PatternLayout >>log4perl.appender.screen.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>log4perl.appender.mail=Log::Dispatch::Email::MailSend >>log4perl.appender.mail.name=Veronicad >>log4perl.appender.mail.subject=Veronicad event >>log4perl.appender.mail.to=yo...@yo... *** >>log4perl.appender.mail.from=yo...@yo... *** >>log4perl.appender.mail.buffered=0 >>log4perl.appender.mail.server=mail.yourdomain.com *** >>log4perl.appender.mail.layout=Log::Log4perl::Layout::PatternLayout >>log4perl.appender.mail.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>'); >>my $logger = Log::Log4perl::get_logger("Veronicad"); >> >>$logger->error("Testing errors"); >>--------------------------------------------------------------- >> >>Jose Vicente Nunez Zuleta wrote: >> >>>First of all thanks for this cool port of the Log4j API; This tool is going to make our lives easier :) >>> >>>So far i managed to add the logging functionality to my application (part of my perl code): >>> >>>use constant OK_CODE => 0; >>>use constant ERROR_CODE => 1; >>>use constant LOG_CONFIG => "/usr/local/sysadmin/VeronicadLog4perl.properties"; >>>use constant REFRESH_LOG_CONFIG => 300; >>> >>># ----- END User configurable parameters -------- >>> >>># Start the logger >>>Log::Log4perl->init_and_watch(LOG_CONFIG, REFRESH_LOG_CONFIG); >>>my $logger = get_logger("Veronicad"); >>> >>>$logger->error("Testing errors"); >>> >>>And here is my configuration file info with three appenders: >>> >>>log4perl.logger.Veronicad=DEBUG, syslog, screen, mail >>>log4perl.appender.screen=Log::Dispatch::Screen >>>log4perl.appender.screen.stderr=0 >>>log4perl.appender.screen.layout=Log::Log4perl::Layout::PatternLayout >>>log4perl.appender.screen.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>>log4perl.appender.syslog=Log::Dispatch::Syslog >>>log4perl.appender.syslog.name=Veronicad >>>log4perl.appender.syslog.facility=daemon >>>log4perl.appender.syslog.socket=inet >>>log4perl.appender.syslog.layout=Log::Log4perl::Layout::PatternLayout >>>log4perl.appender.syslog.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>>log4perl.appender.mail=Log::Dispatch::Email::MailSend >>>log4perl.appender.mail.name=Veronicad >>>log4perl.appender.mail.subject=Veronicad event >>>log4perl.appender.mail.to=my...@em...dress >>>log4perl.appender.mail.from=sm...@em...dress >>>log4perl.appender.mail.buffered=0 >>>log4perl.appender.mail.server=my.mail.server <--- NOT SURE ABOUT THIS!!!!!! >>>log4perl.appender.mail.layout=Log::Log4perl::Layout::PatternLayout >>>log4perl.appender.mail.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>> >>>But the application doesn't sends an email when i got an error (just runs without sending the email): >>> >>>bash-2.04# ./Veronicad.pl >>>2002/09/18 14:36:16 ERROR> Veronicad.pl:34 main:: - Testing errors >>>2002/09/18 14:36:16 INFO> Veronicad.pl:45 main:: - [Server ./Veronicad.pl accepting clients] >>> >>> >>>So far reading the man page i found that "Log::Dispatch::Email::MailSend" is a subclass of 'Mail::Send' wich also inherits >>>from 'Mail::Mailer'. 'Mail::Mailer' can specify to use an external SMTP server like this: >>> >>>""smtp"" >>> Use the "smtp" protocol via Net::SMTP to deliver the >>> mail. The server to use can be specified in "@args" >>> with >>> >>> $mailer = new Mail::Mailer 'smtp', Server => $server; >>> >>> The smtp mailer does not handle "Cc" and "Bcc" lines, >>> neither their "Resent-*" fellows. The "Debug" options >>> enables debugging output from "Net::SMTP". >>> >>> >>>How i can achieve the same using 'Log::Dispatch::Email::MailSend' class? >>> >>>There is a environment variable i can set so i can force the ussage of this SMTP server? >>> >>>There is a way to debug if this is working? >>> >>>I can send email using the external mail server using Net::SMTP and that class is already installed on my system. >>> >>>Thanks in advance, >>> >>>Jose Vicente. >>> >>> >>> >> >> >>-- >>Happy Trails . . . >> >>Kevin M. Goess >>(and Anne and Frank) >>904 Carmel Ave. >>Albany, CA 94706 >>(510) 525-5217 >> > > > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-09-19 00:07:46
|
That's part of what I'm still working on. wu hai wrote: > Thank you for your reply. I tested the script with CSV and MySQL. The > 'level' field will always be 0, no matter what level it is. Is this a bug? > > Wu > >> From: Kevin Goess <ke...@go...> >> Reply-To: cp...@go... >> To: wu hai <wh...@ho...> >> CC: log...@li... >> Subject: Re: log4perl DBI >> Date: Wed, 18 Sep 2002 08:30:16 -0700 >> >> Wu, you an get good mileage out of using the Log::Dispatch::DBI, see >> the attached test script. I'm still working on integrating a DBI >> appender more fully into Log4perl, that'll probably be out in the next >> release. >> >> >> wu hai wrote: >> >>> Dear Sir, >>> >>> The Log::Log4perl is a great package. >>> >>> However I could not find any sample codes for using DBI appender. I >>> also could not find souce implementations of it after I downloaded >>> the lastest version. Could you please provide sample codes for doing >>> this? Or I have to use Log::Dispatch::DBI to handle this? >>> >>> Thanks, >>> Hai >>> >>> >>> _________________________________________________________________ >>> Send and receive Hotmail on your mobile device: http://mobile.msn.com >>> >> >> >> -- >> Happy Trails . . . >> >> Kevin M. Goess >> (and Anne and Frank) >> 904 Carmel Ave. >> Albany, CA 94706 >> (510) 525-5217 >> << 026DBI.t >> > > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: wu h. <wh...@ho...> - 2002-09-18 23:38:15
|
Thank you for your reply. I tested the script with CSV and MySQL. The 'level' field will always be 0, no matter what level it is. Is this a bug? Wu >From: Kevin Goess <ke...@go...> >Reply-To: cp...@go... >To: wu hai <wh...@ho...> >CC: log...@li... >Subject: Re: log4perl DBI >Date: Wed, 18 Sep 2002 08:30:16 -0700 > >Wu, you an get good mileage out of using the Log::Dispatch::DBI, see the >attached test script. I'm still working on integrating a DBI appender more >fully into Log4perl, that'll probably be out in the next release. > > >wu hai wrote: >>Dear Sir, >> >>The Log::Log4perl is a great package. >> >>However I could not find any sample codes for using DBI appender. I also >>could not find souce implementations of it after I downloaded the lastest >>version. Could you please provide sample codes for doing this? Or I have >>to use Log::Dispatch::DBI to handle this? >> >>Thanks, >>Hai >> >> >>_________________________________________________________________ >>Send and receive Hotmail on your mobile device: http://mobile.msn.com >> > > >-- >Happy Trails . . . > >Kevin M. Goess >(and Anne and Frank) >904 Carmel Ave. >Albany, CA 94706 >(510) 525-5217 ><< 026DBI.t >> _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx |
From: Dave R. <au...@ur...> - 2002-09-18 23:34:38
|
On Wed, 18 Sep 2002 Msc...@ao... wrote: > that's probably a question which Log::Dispatch::Email::MailSend author Dave > Rolsky could answer, Cc:ing him ... Well, the easy way to do this seems to be: use Mail::Mailer 'smtp', Server => 'foo.com'; Just do this in your code somewhere before creating the dispatch object. -dave /*================== www.urth.org we await the New Sun ==================*/ |
From: Jose V. N. Z. <jo...@ne...> - 2002-09-18 22:15:37
|
Is really bizarre... i tested the code on another machine and it works. B= ut if i use your code in the same machine then no email is sent. At least i known that the "server" property works :) I went and run a small program i have that uses Net::SMTP directly and th= is is what i got (the email is sent): Net::SMTP: Net::SMTP(2.15) Net::SMTP: Net::Cmd(2.18) Net::SMTP: Exporter(5.562) Net::SMTP: IO::Socket::INET(1.25) Net::SMTP: IO::Socket(1.26) Net::SMTP: IO::Handle(1.21) Net::SMTP=3DGLOB(0x103244)<<< 220 ZZZZ ESMTP Sendmail WWW/WWW; Wed, 18 Se= p 2002 18:08:38 -0400 Net::SMTP=3DGLOB(0x103244)>>> EHLO YYYY Net::SMTP=3DGLOB(0x103244)<<< 250-ZZZZZ Hello sol0001.ZZZZZ [XX.XX.XX.XX= ], pleased to meet you Net::SMTP=3DGLOB(0x103244)<<< 250-ENHANCEDSTATUSCODES Net::SMTP=3DGLOB(0x103244)<<< 250-8BITMIME Net::SMTP=3DGLOB(0x103244)<<< 250-SIZE Net::SMTP=3DGLOB(0x103244)<<< 250-DSN Net::SMTP=3DGLOB(0x103244)<<< 250-ONEX Net::SMTP=3DGLOB(0x103244)<<< 250-ETRN Net::SMTP=3DGLOB(0x103244)<<< 250-XUSR Net::SMTP=3DGLOB(0x103244)<<< 250 HELP Net::SMTP=3DGLOB(0x103244)>>> MAIL FROM:<KKKKK> Net::SMTP=3DGLOB(0x103244)<<< 250 2.1.0 <KKKKK>... Sender ok Net::SMTP=3DGLOB(0x103244)>>> RCPT TO:<KKKKK> Net::SMTP=3DGLOB(0x103244)<<< 250 2.1.5 <KKKK>... Recipient ok Net::SMTP=3DGLOB(0x103244)>>> DATA Net::SMTP=3DGLOB(0x103244)<<< 354 Enter mail, end with "." on a line by i= tself Net::SMTP=3DGLOB(0x103244)>>> To: KKKK Net::SMTP=3DGLOB(0x103244)>>> Subject: Testing mail program Net::SMTP=3DGLOB(0x103244)>>>=20 Net::SMTP=3DGLOB(0x103244)>>> This is a test message Net::SMTP=3DGLOB(0x103244)>>> . Net::SMTP=3DGLOB(0x103244)<<< 250 2.0.0 g8IM8cu32649 Message accepted for= delivery Net::SMTP=3DGLOB(0x103244)>>> QUIT Net::SMTP=3DGLOB(0x103244)<<< 221 2.0.0 ZZZZZ closing connection I'm clueless here. There is a way i can activate the Debug option from th= e logger so i can see whats going on? Thanks in advance. JV. On Wed, 18 Sep 2002 14:53:24 -0700 Kevin Goess <ke...@go...> wrote: > Jose, this works for me, I get an email just fine, note that mail.serve= r=20 > should be your outgoing smtp server, right? >=20 > --------------------------------------------- > use Log::Log4perl; >=20 > Log::Log4perl->init(\' > log4perl.logger.Veronicad=3DDEBUG, screen, mail > log4perl.appender.screen=3DLog::Dispatch::Screen > log4perl.appender.screen.stderr=3D0 > log4perl.appender.screen.layout=3DLog::Log4perl::Layout::PatternLayout > log4perl.appender.screen.layout.ConversionPattern=3D%d %p> %F{1}:%L %M = - %m%n > log4perl.appender.mail=3DLog::Dispatch::Email::MailSend > log4perl.appender.mail.name=3DVeronicad > log4perl.appender.mail.subject=3DVeronicad event > log4perl.appender.mail.to=3D...@yo... *** > log4perl.appender.mail.from=3D...@yo... *** > log4perl.appender.mail.buffered=3D0 > log4perl.appender.mail.server=3Dmail.yourdomain.com *** > log4perl.appender.mail.layout=3DLog::Log4perl::Layout::PatternLayout > log4perl.appender.mail.layout.ConversionPattern=3D%d %p> %F{1}:%L %M - = %m%n > '); > my $logger =3D Log::Log4perl::get_logger("Veronicad"); >=20 > $logger->error("Testing errors"); > --------------------------------------------------------------- >=20 > Jose Vicente Nunez Zuleta wrote: > > First of all thanks for this cool port of the Log4j API; This tool is= going to make our lives easier :) > >=20 > > So far i managed to add the logging functionality to my application (= part of my perl code): > >=20 > > use constant OK_CODE =3D> 0; > > use constant ERROR_CODE =3D> 1; > > use constant LOG_CONFIG =3D> "/usr/local/sysadmin/VeronicadLog4perl.p= roperties"; > > use constant REFRESH_LOG_CONFIG =3D> 300; > >=20 > > # ----- END User configurable parameters -------- > >=20 > > # Start the logger > > Log::Log4perl->init_and_watch(LOG_CONFIG, REFRESH_LOG_CONFIG); > > my $logger =3D get_logger("Veronicad"); > >=20 > > $logger->error("Testing errors"); > >=20 > > And here is my configuration file info with three appenders: > >=20 > > log4perl.logger.Veronicad=3DDEBUG, syslog, screen, mail > > log4perl.appender.screen=3DLog::Dispatch::Screen > > log4perl.appender.screen.stderr=3D0 > > log4perl.appender.screen.layout=3DLog::Log4perl::Layout::PatternLayou= t > > log4perl.appender.screen.layout.ConversionPattern=3D%d %p> %F{1}:%L %= M - %m%n > > log4perl.appender.syslog=3DLog::Dispatch::Syslog > > log4perl.appender.syslog.name=3DVeronicad > > log4perl.appender.syslog.facility=3Ddaemon > > log4perl.appender.syslog.socket=3Dinet > > log4perl.appender.syslog.layout=3DLog::Log4perl::Layout::PatternLayou= t > > log4perl.appender.syslog.layout.ConversionPattern=3D%d %p> %F{1}:%L %= M - %m%n > > log4perl.appender.mail=3DLog::Dispatch::Email::MailSend > > log4perl.appender.mail.name=3DVeronicad > > log4perl.appender.mail.subject=3DVeronicad event > > log4perl.appender.mail.to=3D...@em...dress > > log4perl.appender.mail.from=3D...@em...dress > > log4perl.appender.mail.buffered=3D0 > > log4perl.appender.mail.server=3Dmy.mail.server <--- NOT SURE ABOUT T= HIS!!!!!! > > log4perl.appender.mail.layout=3DLog::Log4perl::Layout::PatternLayout > > log4perl.appender.mail.layout.ConversionPattern=3D%d %p> %F{1}:%L %M = - %m%n > >=20 > > But the application doesn't sends an email when i got an error (just = runs without sending the email): > >=20 > > bash-2.04# ./Veronicad.pl=20 > > 2002/09/18 14:36:16 ERROR> Veronicad.pl:34 main:: - Testing errors > > 2002/09/18 14:36:16 INFO> Veronicad.pl:45 main:: - [Server ./Veronica= d.pl accepting clients] > >=20 > >=20 > > So far reading the man page i found that "Log::Dispatch::Email::MailS= end" is a subclass of 'Mail::Send' wich also inherits > > from 'Mail::Mailer'. 'Mail::Mailer' can specify to use an external SM= TP server like this: > >=20 > > ""smtp"" > > Use the "smtp" protocol via Net::SMTP to deliver the > > mail. The server to use can be specified in "@args" > > with > >=20 > > $mailer =3D new Mail::Mailer 'smtp', Server =3D> $serv= er; > >=20 > > The smtp mailer does not handle "Cc" and "Bcc" lines, > > neither their "Resent-*" fellows. The "Debug" options > > enables debugging output from "Net::SMTP". > >=20 > >=20 > > How i can achieve the same using 'Log::Dispatch::Email::MailSend' cla= ss? > >=20 > > There is a environment variable i can set so i can force the ussage o= f this SMTP server? > >=20 > > There is a way to debug if this is working? > >=20 > > I can send email using the external mail server using Net::SMTP and t= hat class is already installed on my system. > >=20 > > Thanks in advance, > >=20 > > Jose Vicente. > >=20 > >=20 > >=20 >=20 >=20 > --=20 > Happy Trails . . . >=20 > Kevin M. Goess > (and Anne and Frank) > 904 Carmel Ave. > Albany, CA 94706 > (510) 525-5217 >=20 --=20 Jos=E9 Vicente N=FA=F1ez Zuleta Newbreak LLC System Administrator (http://www.newbreak.com) Phone: 203-355-1511, 203-355-1510 Fax: 203-355-1512 |
From: Kevin G. <ke...@go...> - 2002-09-18 21:53:37
|
Jose, this works for me, I get an email just fine, note that mail.server should be your outgoing smtp server, right? --------------------------------------------- use Log::Log4perl; Log::Log4perl->init(\' log4perl.logger.Veronicad=DEBUG, screen, mail log4perl.appender.screen=Log::Dispatch::Screen log4perl.appender.screen.stderr=0 log4perl.appender.screen.layout=Log::Log4perl::Layout::PatternLayout log4perl.appender.screen.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n log4perl.appender.mail=Log::Dispatch::Email::MailSend log4perl.appender.mail.name=Veronicad log4perl.appender.mail.subject=Veronicad event log4perl.appender.mail.to=yo...@yo... *** log4perl.appender.mail.from=yo...@yo... *** log4perl.appender.mail.buffered=0 log4perl.appender.mail.server=mail.yourdomain.com *** log4perl.appender.mail.layout=Log::Log4perl::Layout::PatternLayout log4perl.appender.mail.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n '); my $logger = Log::Log4perl::get_logger("Veronicad"); $logger->error("Testing errors"); --------------------------------------------------------------- Jose Vicente Nunez Zuleta wrote: > First of all thanks for this cool port of the Log4j API; This tool is going to make our lives easier :) > > So far i managed to add the logging functionality to my application (part of my perl code): > > use constant OK_CODE => 0; > use constant ERROR_CODE => 1; > use constant LOG_CONFIG => "/usr/local/sysadmin/VeronicadLog4perl.properties"; > use constant REFRESH_LOG_CONFIG => 300; > > # ----- END User configurable parameters -------- > > # Start the logger > Log::Log4perl->init_and_watch(LOG_CONFIG, REFRESH_LOG_CONFIG); > my $logger = get_logger("Veronicad"); > > $logger->error("Testing errors"); > > And here is my configuration file info with three appenders: > > log4perl.logger.Veronicad=DEBUG, syslog, screen, mail > log4perl.appender.screen=Log::Dispatch::Screen > log4perl.appender.screen.stderr=0 > log4perl.appender.screen.layout=Log::Log4perl::Layout::PatternLayout > log4perl.appender.screen.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n > log4perl.appender.syslog=Log::Dispatch::Syslog > log4perl.appender.syslog.name=Veronicad > log4perl.appender.syslog.facility=daemon > log4perl.appender.syslog.socket=inet > log4perl.appender.syslog.layout=Log::Log4perl::Layout::PatternLayout > log4perl.appender.syslog.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n > log4perl.appender.mail=Log::Dispatch::Email::MailSend > log4perl.appender.mail.name=Veronicad > log4perl.appender.mail.subject=Veronicad event > log4perl.appender.mail.to=my...@em...dress > log4perl.appender.mail.from=sm...@em...dress > log4perl.appender.mail.buffered=0 > log4perl.appender.mail.server=my.mail.server <--- NOT SURE ABOUT THIS!!!!!! > log4perl.appender.mail.layout=Log::Log4perl::Layout::PatternLayout > log4perl.appender.mail.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n > > But the application doesn't sends an email when i got an error (just runs without sending the email): > > bash-2.04# ./Veronicad.pl > 2002/09/18 14:36:16 ERROR> Veronicad.pl:34 main:: - Testing errors > 2002/09/18 14:36:16 INFO> Veronicad.pl:45 main:: - [Server ./Veronicad.pl accepting clients] > > > So far reading the man page i found that "Log::Dispatch::Email::MailSend" is a subclass of 'Mail::Send' wich also inherits > from 'Mail::Mailer'. 'Mail::Mailer' can specify to use an external SMTP server like this: > > ""smtp"" > Use the "smtp" protocol via Net::SMTP to deliver the > mail. The server to use can be specified in "@args" > with > > $mailer = new Mail::Mailer 'smtp', Server => $server; > > The smtp mailer does not handle "Cc" and "Bcc" lines, > neither their "Resent-*" fellows. The "Debug" options > enables debugging output from "Net::SMTP". > > > How i can achieve the same using 'Log::Dispatch::Email::MailSend' class? > > There is a environment variable i can set so i can force the ussage of this SMTP server? > > There is a way to debug if this is working? > > I can send email using the external mail server using Net::SMTP and that class is already installed on my system. > > Thanks in advance, > > Jose Vicente. > > > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Jose V. N. Z. <jo...@ne...> - 2002-09-18 20:16:14
|
Thanks a lot for your answer. Hopefully you guys will bring more ligth in= to this issue :) JV. On Wed, 18 Sep 2002 16:04:11 EDT Msc...@ao... wrote: > Hi Jose, >=20 > that's probably a question which Log::Dispatch::Email::MailSend author = Dave=20 > Rolsky could answer, Cc:ing him ... >=20 > -- Mike >=20 > Mike Schilli > log...@pe... > http://perlmeister.com > http://log4perl.sourceforge.net >=20 --=20 Jos=E9 Vicente N=FA=F1ez Zuleta Newbreak LLC System Administrator (http://www.newbreak.com) Phone: 203-355-1511, 203-355-1510 Fax: 203-355-1512 |
From: Jose V. N. Z. <jo...@ne...> - 2002-09-18 18:36:49
|
First of all thanks for this cool port of the Log4j API; This tool is goi= ng to make our lives easier :) So far i managed to add the logging functionality to my application (part= of my perl code): use constant OK_CODE =3D> 0; use constant ERROR_CODE =3D> 1; use constant LOG_CONFIG =3D> "/usr/local/sysadmin/VeronicadLog4perl.prope= rties"; use constant REFRESH_LOG_CONFIG =3D> 300; # ----- END User configurable parameters -------- # Start the logger Log::Log4perl->init_and_watch(LOG_CONFIG, REFRESH_LOG_CONFIG); my $logger =3D get_logger("Veronicad"); $logger->error("Testing errors"); And here is my configuration file info with three appenders: log4perl.logger.Veronicad=3DDEBUG, syslog, screen, mail log4perl.appender.screen=3DLog::Dispatch::Screen log4perl.appender.screen.stderr=3D0 log4perl.appender.screen.layout=3DLog::Log4perl::Layout::PatternLayout log4perl.appender.screen.layout.ConversionPattern=3D%d %p> %F{1}:%L %M - = %m%n log4perl.appender.syslog=3DLog::Dispatch::Syslog log4perl.appender.syslog.name=3DVeronicad log4perl.appender.syslog.facility=3Ddaemon log4perl.appender.syslog.socket=3Dinet log4perl.appender.syslog.layout=3DLog::Log4perl::Layout::PatternLayout log4perl.appender.syslog.layout.ConversionPattern=3D%d %p> %F{1}:%L %M - = %m%n log4perl.appender.mail=3DLog::Dispatch::Email::MailSend log4perl.appender.mail.name=3DVeronicad log4perl.appender.mail.subject=3DVeronicad event log4perl.appender.mail.to=3D...@em...dress log4perl.appender.mail.from=3D...@em...dress log4perl.appender.mail.buffered=3D0 log4perl.appender.mail.server=3Dmy.mail.server <--- NOT SURE ABOUT THIS!= !!!!! log4perl.appender.mail.layout=3DLog::Log4perl::Layout::PatternLayout log4perl.appender.mail.layout.ConversionPattern=3D%d %p> %F{1}:%L %M - %m= %n But the application doesn't sends an email when i got an error (just runs= without sending the email): bash-2.04# ./Veronicad.pl=20 2002/09/18 14:36:16 ERROR> Veronicad.pl:34 main:: - Testing errors 2002/09/18 14:36:16 INFO> Veronicad.pl:45 main:: - [Server ./Veronicad.pl= accepting clients] So far reading the man page i found that "Log::Dispatch::Email::MailSend"= is a subclass of 'Mail::Send' wich also inherits from 'Mail::Mailer'. 'Mail::Mailer' can specify to use an external SMTP s= erver like this: ""smtp"" Use the "smtp" protocol via Net::SMTP to deliver the mail. The server to use can be specified in "@args" with $mailer =3D new Mail::Mailer 'smtp', Server =3D> $server; The smtp mailer does not handle "Cc" and "Bcc" lines, neither their "Resent-*" fellows. The "Debug" options enables debugging output from "Net::SMTP". How i can achieve the same using 'Log::Dispatch::Email::MailSend' class? There is a environment variable i can set so i can force the ussage of th= is SMTP server? There is a way to debug if this is working? I can send email using the external mail server using Net::SMTP and that = class is already installed on my system. Thanks in advance, Jose Vicente. --=20 Jos=E9 Vicente N=FA=F1ez Zuleta Newbreak LLC System Administrator (http://www.newbreak.com) Phone: 203-355-1511, 203-355-1510 Fax: 203-355-1512 |
From: Kevin G. <ke...@go...> - 2002-09-18 15:30:22
|
Wu, you an get good mileage out of using the Log::Dispatch::DBI, see the attached test script. I'm still working on integrating a DBI appender more fully into Log4perl, that'll probably be out in the next release. wu hai wrote: > Dear Sir, > > The Log::Log4perl is a great package. > > However I could not find any sample codes for using DBI appender. I also > could not find souce implementations of it after I downloaded the > lastest version. Could you please provide sample codes for doing this? > Or I have to use Log::Dispatch::DBI to handle this? > > Thanks, > Hai > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: <Msc...@ao...> - 2002-09-17 22:20:08
|
From: Kevin G. <ke...@go...> - 2002-09-17 00:03:01
|
Interesting question. A memory reference doesn't come with a timestamp, so the mechanism of watching it to see if it's changed since the last time you looked at it would be considerably different from watching a file. The whole point of the config file is to let users change the logging behavior without having to do any programming. If you're that far inside the guts of the process that it's easier generating a new string reference than changing a file, you can just call init() again. The attached seems to work, why don't you give that a shot? Msc...@ao... wrote: > > > > ------------------------------------------------------------------------ > > Subject: > log4perl: reloading config info from a string > From: > Chris Hostetter <ho...@re...> > Date: > Mon, 16 Sep 2002 15:27:35 -0700 (PDT) > To: > Michael Schilli <log...@pe...> > > > Hi there, > > I had a question regarding your article recent perl.com article... > http://www.perl.com/pub/a/2002/09/11/log4perl.html > > You mention that... > > Or, if you store the configuration description in $string, then you can > initialize it with > > Log::Log4perl->init(\$string); > > You can even have your application check the configuration file in > regular intervals (this obviously works only with files, not with > strings): > > Log::Log4perl->init_and_watch("eat.conf", 60); > > My question is: why not also make it work with "strings" ? > > If the init method could take a scalar ref and an interval, and derefrence > that ref at regular intervals, people could write applications which kept > their configuration info in memory and used whatever method they wanted to > upate it "on the fly" (without updating a config file on disk). > > Even 'cooler' would be if you could pass init a code ref to be evaluated > at regular intervals so people could have their configuration information > come from anywhere they wanted ... but I suppose that could still be > possible using tied variables if support was added for polling scalar > refs at a regular basis. > > -- > > ------------------------------------------------------------------- > "Oh, you're a tricky one." Chris M Hostetter > -- Trisha Weir ho...@re... > > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: <Msc...@ao...> - 2002-09-16 23:32:28
|
From: Kevin G. <ke...@go...> - 2002-09-16 16:14:19
|
Looks clear to me. msc...@ao... wrote: > Hey all, > > I've integrated Kevin's fix (new init_and_watch logic) and posted the release candidate Log::Log4perl 0.23beta4 on log4perl.sourceforge.net. > > If no bugs are found within the next couple of days, I'd say, let's release it to CPAN as 0.23. > > Please try it out and make sure all remaining issues have been resolved :). > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: <msc...@ao...> - 2002-09-15 02:21:50
|
Hey all, I've integrated Kevin's fix (new init_and_watch logic) and posted the release candidate Log::Log4perl 0.23beta4 on log4perl.sourceforge.net. If no bugs are found within the next couple of days, I'd say, let's release it to CPAN as 0.23. Please try it out and make sure all remaining issues have been resolved :). -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |