Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 20527
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: valdez [...] linuxasylum.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Feature Request for Log::Log4perl::Level
Date: Tue, 18 Jul 2006 14:41:28 +0200
To: bug-Log-Log4perl [...] rt.cpan.org
From: Valerio VALDEZ Paolini <valdez [...] linuxasylum.net>
Hello, I'm a very satisfied user of the excellent Log4perl; after two years of intense use of this module, I would like to ask a modification of Log::Log4perl::Level to make configurable the mapping from level FATAL to EMERG inside subroutine to_LogDispatch_string. Is it possible? I'm willing to help you, I just need some guidance :) Thank you very much! Ciao, Valerio
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Thu, 20 Jul 2006 22:51:20 -0700 (PDT)
To: "valdez [...] linuxasylum.net via RT" <bug-Log-Log4perl [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Tue, 18 Jul 2006, valdez@linuxasylum.net via RT wrote: Show quoted text
> I'm a very satisfied user of the excellent Log4perl; > years of intense use of this module, I would like to ask a > modification of Log::Log4perl::Level to make configurable the > mapping from level FATAL to EMERG inside subroutine > to_LogDispatch_string.
Hi Valerio, I'm glad to hear you like Log4perl! Regarding your request, can you elaborate a bit why you would want to configure the mapping? It looks to me like we could potentially accomplish what you want in some other way, but I need to know details on what you're trying to accomplish. Let me know, please! -- Mike Mike Schilli m@perlmeister.com
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Fri, 21 Jul 2006 12:35:48 +0200 (CEST)
To: Mike Schilli via RT <bug-Log-Log4perl [...] rt.cpan.org>
From: Valerio VALDEZ Paolini <valdez [...] linuxasylum.net>
Hello, On Fri, 21 Jul 2006, Mike Schilli via RT wrote: Show quoted text
> Regarding your request, can you elaborate a bit why you would want > to configure the mapping? It looks to me like we could potentially > accomplish what you want in some other way, but I need to know details > on what you're trying to accomplish. Let me know, please!
in Log/Log4perl/Level.pm you define the allowed logging levels for log4perl: DEBUG INFO WARN ERROR FATAL and list the following levels from Log::Dispatch: # Set up the mapping between Log4perl integer levels and # Log::Dispatch levels # Note: Log::Dispatch uses the following levels: # 0 debug # 1 info # 2 notice # 3 warning # 4 error # 5 critical # 6 alert # 7 emergency The mapping between FATAL and EMERGENCY is hardcoded, but I would like to redefine it to CRITICAL or ALERT; the main reason for doing this is that I think EMERGENCY should be used only for situations where the system itself, and not an application, is unuseable. I hope to have clarified my request. I also looked for a way to configure that mapping, but I haven't found anything useful for that purpose. Thank you, Valerio
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Fri, 21 Jul 2006 09:10:37 -0700 (PDT)
To: "valdez [...] linuxasylum.net via RT" <bug-Log-Log4perl [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Fri, 21 Jul 2006, valdez@linuxasylum.net via RT wrote: Show quoted text
> The mapping between FATAL and EMERGENCY is hardcoded, but I would > like to redefine it to CRITICAL or ALERT; the main reason for doing this > is that I think EMERGENCY should be used only for situations where the > system itself, and not an application, is unuseable.
Ah, I understand now. With the current implementation, it can be done, but it is a bit of a hack. 1) You can break into L4p's level definition: $Log::Log4perl::Level::$L4P_TO_LD{FATAL} = 5; # (or 6) 2) Define a new custom level in L4p which maps to what you want on the LD side: Log::Log4perl::Logger::create_custom_level("MYFATAL", "FATAL", 5); Would any of these work for you? -- Mike Mike Schilli m@perlmeister.com
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Fri, 21 Jul 2006 18:31:27 +0200 (CEST)
To: Mike Schilli via RT <bug-Log-Log4perl [...] rt.cpan.org>
From: Valerio VALDEZ Paolini <valdez [...] linuxasylum.net>
Hello, On Fri, 21 Jul 2006, Mike Schilli via RT wrote: Show quoted text
> Ah, I understand now. > With the current implementation, it can be done, but it is a bit of a hack.
[..] Show quoted text
> Would any of these work for you?
both solutions will work, but I would prefer to have a configurable options in a configuration file, it would be a lot better! Without giving too much details, I work in an environment with hundreds of servers and thousands applications; changing configuration files instead of applications code would be much more easier and safer; better, it could also be delegated to an administrator :) Having said that, how can I help to make this change? Thanks again, Valerio
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Fri, 21 Jul 2006 22:00:55 -0700 (PDT)
To: "valdez [...] linuxasylum.net via RT" <bug-Log-Log4perl [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Fri, 21 Jul 2006, valdez@linuxasylum.net via RT wrote: Show quoted text
> both solutions will work, but I would prefer to have a configurable > options in a configuration file, it would be a lot better! > > Without giving too much details, I work in an environment with hundreds of > servers and thousands applications; changing configuration files instead > of applications code would be much more easier and safer; better, it could > also be delegated to an administrator :) > Having said that, how can I help to make this change?
Hmmm ... this would be a deviation from the Log4j standard in Log4perl, which I'm very careful with. -- Mike Mike Schilli m@perlmeister.com
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Tue, 25 Jul 2006 20:11:58 +0200
To: bug-Log-Log4perl [...] rt.cpan.org
From: Valerio VALDEZ Paolini <valdez [...] linuxasylum.net>
Hello, On Tuesday 25 July 2006 07:36, Mike Schilli via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=20527 > > > On Fri, 21 Jul 2006, valdez@linuxasylum.net via RT wrote:
> > both solutions will work, but I would prefer to have a configurable > > options in a configuration file, it would be a lot better!
> > Hmmm ... this would be a deviation from the Log4j standard in Log4perl, > which I'm very careful with.
I fully understand your position; however I'm still willing to help you introduce this new feature if you will ever change your mind. Just for my curiosity, how does Log4j resolve this issue? Thanks, Valerio
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Tue, 25 Jul 2006 14:22:24 -0700 (PDT)
To: "valdez [...] linuxasylum.net via RT" <bug-Log-Log4perl [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Tue, 25 Jul 2006, valdez@linuxasylum.net via RT wrote: Show quoted text
> I fully understand your position; however I'm still willing to help you > introduce this new feature if you will ever change your mind. > > Just for my curiosity, how does Log4j resolve this issue?
Log4j doesn't deal with Log::Dispatch, of course :). -- Mike Mike Schilli m@perlmeister.com
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Wed, 26 Jul 2006 10:06:45 +0200
To: bug-Log-Log4perl [...] rt.cpan.org
From: Valerio VALDEZ Paolini <valdez [...] linuxasylum.net>
On Tuesday 25 July 2006 23:22, Mike Schilli via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=20527 > >
> > Just for my curiosity, how does Log4j resolve this issue?
> > Log4j doesn't deal with Log::Dispatch, of course :).
sorry for not being clear about this :) I imagine that also Log4j can log to syslog, what level does it map fatal to? Do you think that I should ask help to the author of Log::Dispatch? Ciao, Valerio
Subject: Re: [rt.cpan.org #20527] Feature Request for Log::Log4perl::Level
Date: Wed, 26 Jul 2006 23:18:50 -0700 (PDT)
To: "valdez [...] linuxasylum.net via RT" <bug-Log-Log4perl [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Wed, 26 Jul 2006, valdez@linuxasylum.net via RT wrote: Show quoted text
> I imagine that also Log4j can log to syslog, what level does it map fatal to?
Searching the web for "log4j" and "syslog" brought this up: http://www.jboss.org/?module=bb&op=viewtopic&p=3825293 Show quoted text
> Do you think that I should ask help to the author of Log::Dispatch?
I thought your concern was that you can't solve it in code but need a configuration file? Your problem can be resolved easily with the code I suggested. -- Mike Mike Schilli m@perlmeister.com
Long resolved.