From: Berg, E. <eri...@le...> - 2007-09-27 17:35:43
|
Uh...right. I think that was wishful thinking on my part...I still want to have that file name somewhere. Thanks. I knew there was a good explanation. Eric. -----Original Message----- From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D=20 Sent: Thursday, September 27, 2007 1:21 PM To: Berg, Eric Cc: Mike Schilli; gm_post=40br-online.de; log4perl-devel=40lists.sourceforge.net Subject: RE: =5Blog4perl-devel=5D Logger Properties On Thu, 27 Sep 2007, Berg, Eric wrote: > Well, that's good news, Mike, but what about the following did I not=20 > understand? The mail below referred to the configuration file name, while the previous mail referred to the output file name the file appender uses. Two entirely different animals=21 :) -- Mike Mike Schilli m=40perlmeister.com > This would be nice to have in the docs. > > Thanks. > > -Eric. > > > -----Original Message----- > > From: Mike Schilli =3D5Bmailto:m=3D40perlmeister.com=3D5D > > Sent: Thursday, June 28, 2007 7:54 PM > > To: Berg, Eric > > Cc: log4perl-devel=3D40lists.sourceforge.net > > Subject: Re: =3D5Blog4perl-devel=3D5D When a missing config file > > > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > > > I've been looking for a way to get l4p to tell me where the > config=3D20 > > > under which it's running comes from. Essentially, I'd like to > have=3D20 > > > a method that would return the full path to the config file=20 > > > that=3D20 it's currently using. > > > > > > Obviously, there are complications, such as those relating to=3D20=20 > > > programatic configuration subsequent to loading configs from a=20 > > > file, > > > > in-line, and config (ini) files, but I could find nowhere that > the=3D20 > > > file name passed in to init() is retrievable. > > > > The name of the file isn't stored usually, since you can not only > use=3D20 > > a file but a string, a hashref, an URL, etc. to initialize L4p. > > > > Since you're calling init() in the first place, wouldn't it be > easier=3D20 > > to store the filename in your application instead? > > > > -- Mike > > -----Original Message----- > From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D > Sent: Thursday, September 27, 2007 3:29 AM > To: Berg, Eric > Cc: gm_post=40br-online.de; log4perl-devel=40lists.sourceforge.net > Subject: Re: =5Blog4perl-devel=5D Logger Properties > > On Wed, 26 Sep 2007, Berg, Eric wrote: > > > The answer was that that information isn't kept. For one thing, it=20 > > could be that the configuration was derived or modified=20 > > programatically. > > That's not accurate. Of course it's kept, otherwise the file appender=20 > wouldn't know what the name of the file is, right? :) > > To find the name of the file the file appender is using, first obtain=20 > a reference to the file appender. If you have a configuration like > > log4perl.category.Bar.Twix =3D WARN, Logfile > log4perl.appender.Logfile =3D Log::Log4perl::Appender::File > log4perl.appender.Logfile.filename =3D test.log > ... > > then find the =22Logfile=22 appender via > > my =24app =3D Log::Log4perl->appender_by_name(=22Logfile=22); > > and to obtain the name of the logfile it's using, call its 'filename' > method: > > print =24app->filename(), =22=5Cn=22; > > -- Mike > > Mike Schilli > m=40perlmeister.com > > > > > Nonethless, I think that there are times when it would be very=20 > > helpful > > > to have a path/filename for the config file. One of these days, if=20 > > I get some time........ > > > > Eric. > > > > -----Original Message----- > > From: log4perl-devel-bounces=40lists.sourceforge.net > > =5Bmailto:log4perl-devel-bounces=40lists.sourceforge.net=5D On Behalf = Of=20 > > gm_post=40br-online.de > > Sent: Wednesday, September 26, 2007 5:21 AM > > To: log4perl-devel=40lists.sourceforge.net > > Subject: =5Blog4perl-devel=5D Logger Properties > > > > Hi, > > > > know somebody how can I get the properties of a logger i.e. name of=20 > > used logfile? In log4perl manual I don't fint any hint. > > > > Example: > > > > =24logger =3D Log::Log4perl->get_logger('loggername'); > > > > I miss something like: > > > > %properties =3D =24logger->get_logger_properties(); =24current_logfile = =3D=20 > > =24properties=7Bfilename=7D; > > > > Thanks Gerd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |