From: Manuel de V. B. <mba...@re...> - 2002-11-01 11:43:13
|
I have problem configuring syslog appender (Log-Dispatch-2.01) to work=20 with Log4Perl(Log-Log4perl-0.25). I use these script and config file: script ------------------------------------------------ #! /usr/local/bin/perl use strict; use Log::Log4perl qw(get_logger :levels); Log::Log4perl::init('log4perl.conf'); my $logger =3D get_logger(""); $logger->level($INFO); print "Ahora con nivel ERROR\n"; $logger->info("principal INFO"); $logger->error("principal ERROR"); ------------------------------------------------- config file ------------------------------------------------- log4j.rootLogger =3D ERROR, B1, A1 log4j.appender.A1=3DLog::Dispatch::Screen log4j.appender.A1.layout=3Dorg.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=3D%d [%t] %-5p %c - %m%n log4j.appender.B1 =3D Log::Dispatch::Syslog log4j.appender.B1.layout =3D Log::Log4perl::Layout::SimpleLayout log4j.appender.B1.name =3D file1 log4j.appender.B1.min_level =3D error log4j.appender.B1.ident =3D prueba log4j.appender.B1.level =3D error log4j.appender.B1.facility =3D local1 log4j.appender.B1.socket =3D inet ------------------------------------------------- I have tried a simple script using only=20 Syslog daemon and Log-Dispatch-2.01: ------------------------------------------------ #! /usr/local/bin/perl use Log::Dispatch::Syslog; my $file =3D Log::Dispatch::Syslog->new( name =3D> 'file1', min_level =3D> 'info', socket =3D> 'inet', facility =3D> 'local1', ident =3D> 'prueba' ); $file->log( level =3D> "error", message =3D> "un mensajito 3" ); -------------------------------------------------------- that work fine, so I think something is wrong in log4perl config file. Anyone can help me? Thanks -- ---------------------------------------------------------------------------= --- p.d. (Only for future Spanish Translators) Te animas con alguna de las ayudas de gnome-core, gnome-applets o gnome-utils? http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayudas-1.= 4.html Manuel de Vega Barreiro. mba...@re... En un lugar de la red Madrid. Espa=F1a. usuario linux: 17.419, 62.146 de cuyo nombre no quiero http://www.linuxlots.com/~barreiro Linux Landia acordarme.......... ---------------------------------------------------------------------------= --- |
From: Kevin G. <ke...@go...> - 2002-11-01 17:25:17
|
Manuel, you didn't say what you have in your syslog.conf, but I'll bet=20 it's something like the relevant line from mine: *.info;mail.none;authpriv.none;cron.none \ /var/log/messages which catches all messages of level info or higher. The log4perl api is designed to be a single point of control for=20 enabling/disabling logging messages, the decision whether to log or not=20 to log is taken at the log4perl level before the message gets passed on=20 to whatever is implementing the appender, in this case=20 Log::Dispatch::Syslog. We didn't want to have *two* points of control,=20 so all the messages that come out of log4perl are of level 'DEBUG', so=20 your syslog is seeing a DEBUG message, but it's set up to only include=20 INFO messages. So if you add this line to your syslog.conf local1.debug /var/log/messages and take the min_level setting out of your log4perl.conf, and give your=20 syslogd a hup then you should see results. Note that I had to set the socket to 'unix' to get results on my=20 machine, but that depends on your setup. Manuel de Vega Barreiro wrote: > I have problem configuring syslog appender (Log-Dispatch-2.01) to work=20 > with Log4Perl(Log-Log4perl-0.25). >=20 > I use these script and config file: > script > ------------------------------------------------ > #! /usr/local/bin/perl > use strict; >=20 > use Log::Log4perl qw(get_logger :levels); > Log::Log4perl::init('log4perl.conf'); >=20 >=20 > my $logger =3D get_logger(""); >=20 >=20 > $logger->level($INFO); > print "Ahora con nivel ERROR\n"; > $logger->info("principal INFO"); > $logger->error("principal ERROR"); > ------------------------------------------------- >=20 > config file > ------------------------------------------------- > log4j.rootLogger =3D ERROR, B1, A1 >=20 > log4j.appender.A1=3DLog::Dispatch::Screen > log4j.appender.A1.layout=3Dorg.apache.log4j.PatternLayout > log4j.appender.A1.layout.ConversionPattern=3D%d [%t] %-5p %c - %m%n >=20 > log4j.appender.B1 =3D Log::Dispatch::Syslog > log4j.appender.B1.layout =3D Log::Log4perl::Layout::SimpleLayout > log4j.appender.B1.name =3D file1 > log4j.appender.B1.min_level =3D error > log4j.appender.B1.ident =3D prueba > log4j.appender.B1.level =3D error > log4j.appender.B1.facility =3D local1 > log4j.appender.B1.socket =3D inet > ------------------------------------------------- >=20 > I have tried a simple script using only=20 > Syslog daemon and Log-Dispatch-2.01: > ------------------------------------------------ > #! /usr/local/bin/perl >=20 > use Log::Dispatch::Syslog; >=20 > my $file =3D Log::Dispatch::Syslog->new( name =3D> 'file1', > min_level =3D> 'info', > socket =3D> 'inet', > facility =3D> 'local1', > ident =3D> 'prueba' ); >=20 > $file->log( level =3D> "error", message =3D> "un mensajito 3" ); > -------------------------------------------------------- > that work fine, so I think something is wrong in log4perl config > file. >=20 > Anyone can help me? >=20 > Thanks >=20 > -- > -----------------------------------------------------------------------= ------- > p.d. (Only for future Spanish Translators) > Te animas con alguna de las ayudas de gnome-core, gnome-applets o > gnome-utils? > http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayuda= s-1.4.html >=20 > Manuel de Vega Barreiro. mba...@re... En un lugar de la > red > Madrid. Espa=F1a. usuario linux: 17.419, 62.146 de cuyo nombre n= o > quiero > http://www.linuxlots.com/~barreiro Linux Landia acordarme.......... > -----------------------------------------------------------------------= ------- >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm=20 > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel --=20 Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Manuel de V. B. <mba...@re...> - 2002-11-02 09:47:32
|
Hi Kevin, I have changed the local1 level in the syslog config file, and put off the min_level in log4perl, and now we got messages in log files. I finally agree with you, it's more logical (or almost less surprising) to send messages to syslog as 'emerg' ones. Thanks =20 El vie, 01-11-2002 a las 18:25, Kevin Goess escribi=F3: > Manuel, you didn't say what you have in your syslog.conf, but I'll bet=20 > it's something like the relevant line from mine: >=20 > *.info;mail.none;authpriv.none;cron.none \ > /var/log/messages >=20 > which catches all messages of level info or higher. >=20 > The log4perl api is designed to be a single point of control for=20 > enabling/disabling logging messages, the decision whether to log or not=20 > to log is taken at the log4perl level before the message gets passed on=20 > to whatever is implementing the appender, in this case=20 > Log::Dispatch::Syslog. We didn't want to have *two* points of control,=20 > so all the messages that come out of log4perl are of level 'DEBUG', so=20 > your syslog is seeing a DEBUG message, but it's set up to only include=20 > INFO messages. So if you add this line to your syslog.conf >=20 > local1.debug /var/log/messages > > and take the min_level setting out of your log4perl.conf, and give your=20 > syslogd a hup then you should see results. >=20 > Note that I had to set the socket to 'unix' to get results on my=20 > machine, but that depends on your setup. >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Manuel de Vega Barreiro wrote: > > I have problem configuring syslog appender (Log-Dispatch-2.01) to work=20 > > with Log4Perl(Log-Log4perl-0.25). > >=20 > > I use these script and config file: > > script > > ------------------------------------------------ > > #! /usr/local/bin/perl > > use strict; > >=20 > > use Log::Log4perl qw(get_logger :levels); > > Log::Log4perl::init('log4perl.conf'); > >=20 > >=20 > > my $logger =3D get_logger(""); > >=20 > >=20 > > $logger->level($INFO); > > print "Ahora con nivel ERROR\n"; > > $logger->info("principal INFO"); > > $logger->error("principal ERROR"); > > ------------------------------------------------- > >=20 > > config file > > ------------------------------------------------- > > log4j.rootLogger =3D ERROR, B1, A1 > >=20 > > log4j.appender.A1=3DLog::Dispatch::Screen > > log4j.appender.A1.layout=3Dorg.apache.log4j.PatternLayout > > log4j.appender.A1.layout.ConversionPattern=3D%d [%t] %-5p %c - %m%n > >=20 > > log4j.appender.B1 =3D Log::Dispatch::Syslog > > log4j.appender.B1.layout =3D Log::Log4perl::Layout::SimpleLayout > > log4j.appender.B1.name =3D file1 > > log4j.appender.B1.min_level =3D error > > log4j.appender.B1.ident =3D prueba > > log4j.appender.B1.level =3D error > > log4j.appender.B1.facility =3D local1 > > log4j.appender.B1.socket =3D inet > > ------------------------------------------------- > >=20 > > I have tried a simple script using only=20 > > Syslog daemon and Log-Dispatch-2.01: > > ------------------------------------------------ > > #! /usr/local/bin/perl > >=20 > > use Log::Dispatch::Syslog; > >=20 > > my $file =3D Log::Dispatch::Syslog->new( name =3D> 'file1', > > min_level =3D> 'info', > > socket =3D> 'inet', > > facility =3D> 'local1', > > ident =3D> 'prueba' ); > >=20 > > $file->log( level =3D> "error", message =3D> "un mensajito 3" ); > > -------------------------------------------------------- > > that work fine, so I think something is wrong in log4perl config > > file. > >=20 > > Anyone can help me? > >=20 > > Thanks > >=20 > > -- > > -----------------------------------------------------------------------= ------- > > p.d. (Only for future Spanish Translators) > > Te animas con alguna de las ayudas de gnome-core, gnome-applets o > > gnome-utils? > > http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayuda= s-1.4.html > >=20 > > Manuel de Vega Barreiro. mba...@re... En un lugar de la > > red > > Madrid. Espa=F1a. usuario linux: 17.419, 62.146 de cuyo nombre n= o > > quiero > > http://www.linuxlots.com/~barreiro Linux Landia acordarme.........= . > > -----------------------------------------------------------------------= ------- > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This sf.net email is sponsored by: See the NEW Palm=20 > > Tungsten T handheld. Power & Color in a compact size! > > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel >=20 >=20 > --=20 > Happy Trails . . . >=20 > Kevin M. Goess > (and Anne and Frank) > 904 Carmel Ave. > Albany, CA 94706 > (510) 525-5217 >=20 --=20 ---------------------------------------------------------------------------= --- p.d. (Only for future Spanish Translators) Te animas con alguna de las ayudas de gnome-core, gnome-applets o gnome-utils? http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayudas-1.= 4.html Manuel de Vega Barreiro. mba...@re... En un lugar de la red Madrid. Espa=F1a. usuario linux: 17.419, 62.146 de cuyo nombre no quiero http://www.linuxlots.com/~barreiro Linux Landia acordarme.......... ---------------------------------------------------------------------------= --- |
From: Kevin G. <ke...@go...> - 2002-11-01 17:27:09
|
Hey, Mike, when we call Log::Dispatch, we're sending it a message of=20 level 0 (DEBUG), wouldn't it make more sense to send it a 9 or=20 something, which means that log4perl messages would ALWAYS get through=20 instead of SOMETIMES depending on how the underlying appender system is=20 set up? Check out Logger.pm line 205-210 Manuel de Vega Barreiro wrote: > I have problem configuring syslog appender (Log-Dispatch-2.01) to work=20 > with Log4Perl(Log-Log4perl-0.25). >=20 > I use these script and config file: > script > ------------------------------------------------ > #! /usr/local/bin/perl > use strict; >=20 > use Log::Log4perl qw(get_logger :levels); > Log::Log4perl::init('log4perl.conf'); >=20 >=20 > my $logger =3D get_logger(""); >=20 >=20 > $logger->level($INFO); > print "Ahora con nivel ERROR\n"; > $logger->info("principal INFO"); > $logger->error("principal ERROR"); > ------------------------------------------------- >=20 > config file > ------------------------------------------------- > log4j.rootLogger =3D ERROR, B1, A1 >=20 > log4j.appender.A1=3DLog::Dispatch::Screen > log4j.appender.A1.layout=3Dorg.apache.log4j.PatternLayout > log4j.appender.A1.layout.ConversionPattern=3D%d [%t] %-5p %c - %m%n >=20 > log4j.appender.B1 =3D Log::Dispatch::Syslog > log4j.appender.B1.layout =3D Log::Log4perl::Layout::SimpleLayout > log4j.appender.B1.name =3D file1 > log4j.appender.B1.min_level =3D error > log4j.appender.B1.ident =3D prueba > log4j.appender.B1.level =3D error > log4j.appender.B1.facility =3D local1 > log4j.appender.B1.socket =3D inet > ------------------------------------------------- >=20 > I have tried a simple script using only=20 > Syslog daemon and Log-Dispatch-2.01: > ------------------------------------------------ > #! /usr/local/bin/perl >=20 > use Log::Dispatch::Syslog; >=20 > my $file =3D Log::Dispatch::Syslog->new( name =3D> 'file1', > min_level =3D> 'info', > socket =3D> 'inet', > facility =3D> 'local1', > ident =3D> 'prueba' ); >=20 > $file->log( level =3D> "error", message =3D> "un mensajito 3" ); > -------------------------------------------------------- > that work fine, so I think something is wrong in log4perl config > file. >=20 > Anyone can help me? >=20 > Thanks >=20 > -- > -----------------------------------------------------------------------= ------- > p.d. (Only for future Spanish Translators) > Te animas con alguna de las ayudas de gnome-core, gnome-applets o > gnome-utils? > http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayuda= s-1.4.html >=20 > Manuel de Vega Barreiro. mba...@re... En un lugar de la > red > Madrid. Espa=F1a. usuario linux: 17.419, 62.146 de cuyo nombre n= o > quiero > http://www.linuxlots.com/~barreiro Linux Landia acordarme.......... > -----------------------------------------------------------------------= ------- >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm=20 > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel --=20 Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Lars T. <la...@th...> - 2002-11-01 20:01:28
|
Sounds to me like we need to be able to supply the syslog level in the configuration. The current behaviour definitely violates the PoLA (Principle of Least Astonishment). /Lars ----- Original Message ----- From: "Kevin Goess" <ke...@go...> Cc: <log...@li...> Sent: Friday, November 01, 2002 6:27 PM Subject: Re: [log4perl-devel] Using log4Perl and LOG::Log::Dispatch::Syslog appender. Hey, Mike, when we call Log::Dispatch, we're sending it a message of level 0 (DEBUG), wouldn't it make more sense to send it a 9 or something, which means that log4perl messages would ALWAYS get through instead of SOMETIMES depending on how the underlying appender system is set up? Check out Logger.pm line 205-210 Manuel de Vega Barreiro wrote: > I have problem configuring syslog appender (Log-Dispatch-2.01) to work > with Log4Perl(Log-Log4perl-0.25). > > I use these script and config file: > script > ------------------------------------------------ > #! /usr/local/bin/perl > use strict; > > use Log::Log4perl qw(get_logger :levels); > Log::Log4perl::init('log4perl.conf'); > > > my $logger = get_logger(""); > > > $logger->level($INFO); > print "Ahora con nivel ERROR\n"; > $logger->info("principal INFO"); > $logger->error("principal ERROR"); > ------------------------------------------------- > > config file > ------------------------------------------------- > log4j.rootLogger = ERROR, B1, A1 > > log4j.appender.A1=Log::Dispatch::Screen > log4j.appender.A1.layout=org.apache.log4j.PatternLayout > log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n > > log4j.appender.B1 = Log::Dispatch::Syslog > log4j.appender.B1.layout = Log::Log4perl::Layout::SimpleLayout > log4j.appender.B1.name = file1 > log4j.appender.B1.min_level = error > log4j.appender.B1.ident = prueba > log4j.appender.B1.level = error > log4j.appender.B1.facility = local1 > log4j.appender.B1.socket = inet > ------------------------------------------------- > > I have tried a simple script using only > Syslog daemon and Log-Dispatch-2.01: > ------------------------------------------------ > #! /usr/local/bin/perl > > use Log::Dispatch::Syslog; > > my $file = Log::Dispatch::Syslog->new( name => 'file1', > min_level => 'info', > socket => 'inet', > facility => 'local1', > ident => 'prueba' ); > > $file->log( level => "error", message => "un mensajito 3" ); > -------------------------------------------------------- > that work fine, so I think something is wrong in log4perl config > file. > > Anyone can help me? > > Thanks > > -- > -------------------------------------------------------------------------- ---- > p.d. (Only for future Spanish Translators) > Te animas con alguna de las ayudas de gnome-core, gnome-applets o > gnome-utils? > http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayudas-1.4 .html > > Manuel de Vega Barreiro. mba...@re... En un lugar de la > red > Madrid. España. usuario linux: 17.419, 62.146 de cuyo nombre no > quiero > http://www.linuxlots.com/~barreiro Linux Landia acordarme.......... > -------------------------------------------------------------------------- ---- > > > > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > 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 ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ log4perl-devel mailing list log...@li... https://lists.sourceforge.net/lists/listinfo/log4perl-devel |
From: Lars T. <la...@th...> - 2002-11-01 20:01:28
|
Sounds to me like we need to be able to supply the syslog level in the configuration. The current behaviour definitely violates the PoLA (Principle of Least Astonishment). /Lars ----- Original Message ----- From: "Kevin Goess" <ke...@go...> Cc: <log...@li...> Sent: Friday, November 01, 2002 6:27 PM Subject: Re: [log4perl-devel] Using log4Perl and LOG::Log::Dispatch::Syslog appender. Hey, Mike, when we call Log::Dispatch, we're sending it a message of level 0 (DEBUG), wouldn't it make more sense to send it a 9 or something, which means that log4perl messages would ALWAYS get through instead of SOMETIMES depending on how the underlying appender system is set up? Check out Logger.pm line 205-210 Manuel de Vega Barreiro wrote: > I have problem configuring syslog appender (Log-Dispatch-2.01) to work > with Log4Perl(Log-Log4perl-0.25). > > I use these script and config file: > script > ------------------------------------------------ > #! /usr/local/bin/perl > use strict; > > use Log::Log4perl qw(get_logger :levels); > Log::Log4perl::init('log4perl.conf'); > > > my $logger = get_logger(""); > > > $logger->level($INFO); > print "Ahora con nivel ERROR\n"; > $logger->info("principal INFO"); > $logger->error("principal ERROR"); > ------------------------------------------------- > > config file > ------------------------------------------------- > log4j.rootLogger = ERROR, B1, A1 > > log4j.appender.A1=Log::Dispatch::Screen > log4j.appender.A1.layout=org.apache.log4j.PatternLayout > log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n > > log4j.appender.B1 = Log::Dispatch::Syslog > log4j.appender.B1.layout = Log::Log4perl::Layout::SimpleLayout > log4j.appender.B1.name = file1 > log4j.appender.B1.min_level = error > log4j.appender.B1.ident = prueba > log4j.appender.B1.level = error > log4j.appender.B1.facility = local1 > log4j.appender.B1.socket = inet > ------------------------------------------------- > > I have tried a simple script using only > Syslog daemon and Log-Dispatch-2.01: > ------------------------------------------------ > #! /usr/local/bin/perl > > use Log::Dispatch::Syslog; > > my $file = Log::Dispatch::Syslog->new( name => 'file1', > min_level => 'info', > socket => 'inet', > facility => 'local1', > ident => 'prueba' ); > > $file->log( level => "error", message => "un mensajito 3" ); > -------------------------------------------------------- > that work fine, so I think something is wrong in log4perl config > file. > > Anyone can help me? > > Thanks > > -- > -------------------------------------------------------------------------- ---- > p.d. (Only for future Spanish Translators) > Te animas con alguna de las ayudas de gnome-core, gnome-applets o > gnome-utils? > http://www.linuxlots.com/~barreiro/spanish/gnome-es/v1.4/gnome-es-ayudas-1.4 .html > > Manuel de Vega Barreiro. mba...@re... En un lugar de la > red > Madrid. España. usuario linux: 17.419, 62.146 de cuyo nombre no > quiero > http://www.linuxlots.com/~barreiro Linux Landia acordarme.......... > -------------------------------------------------------------------------- ---- > > > > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > 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 ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ log4perl-devel mailing list log...@li... https://lists.sourceforge.net/lists/listinfo/log4perl-devel |