On Thu, 28 Jun 2007, Berg, Eric wrote: > I've been looking for a way to get l4p to tell me where the config > under which it's running comes from. Essentially, I'd like to have > a method that would return the full path to the config file that it's > currently using. > > Obviously, there are complications, such as those relating to > programatic configuration subsequent to loading configs from a file, > in-line, and config (ini) files, but I could find nowhere that the file > name passed in to init() is retrievable.
The name of the file isn't stored usually, since you can not only use 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 to store the filename in your application instead? -- Mike Mike Schilli [EMAIL PROTECTED] > > -Eric. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of John > ORourke > Sent: Thursday, June 28, 2007 6:42 AM > To: Lee Goddard > Cc: log4perl-devel@lists.sourceforge.net > Subject: Re: [log4perl-devel] When a missing config file > > Try putting: > > use Error; > > in one of your modules/scripts - it will override the warn/die handlers > globally, so unless Log4perl overrides them again it will give you a > stack trace. > > cheers > John > > Lee Goddard wrote: > > > > Please could Log/Log4perl/Config.pm line 619 offer a stack backtrace > > as well as barfing? > > > > My current project has four config files, several potential > > initialisers (bad idea, I know) and reports only via e-mail, since it > > is part of a MTA process. > > > > Thanks in anticipation > > > > Lee > > > > > > > > > > > > # The Postfix program > > > > # > > > > # <[EMAIL PROTECTED]>: Command died with status 2: > > "perl > > > > # -I/home/lgoddard/trafficjam/trunk/lib > > -MTrafficJam::Controller::Root -e > > > > # 'warn TrafficJam::Controller::Root->mail_in'". Command output: > > Cannot open > > > > # config file '/home/lgoddard/trafficjam/trunk/config/mail.l4p' at > > > > # /usr/local/share/perl/5.8.4/Log/Log4perl/Config.pm line 619, > > <STDIN> line > > > > # 26. > > > > # > > > > > > > > Lee Goddard > > > > Senior Software Developer > > > > Advertising.com, London > > > > > > > > P Think of the environment before you print this email > > > > > > > > ---------------------------------------------------------------------- > > -- > > > > ---------------------------------------------------------------------- > > --- This SF.net email is sponsored by DB2 Express Download DB2 Express > > > C - the FREE version of DB2 express and take control of your XML. No > > limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > ---------------------------------------------------------------------- > > -- > > > > _______________________________________________ > > log4perl-devel mailing list > > log4perl-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by DB2 Express Download DB2 Express C - > the FREE version of DB2 express and take control of your XML. No limits. > Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > log4perl-devel mailing list > log4perl-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - > > 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. > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > log4perl-devel mailing list > log4perl-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel