Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl and tail -f error_log

Reply
Thread Tools

Perl and tail -f error_log

 
 
Bill H
Guest
Posts: n/a
 
      03-13-2009
I use tail -f to watch for errors in scripts but sometimes it is hard
to see the errors because other programmers may have scripts
generating errors. Is there anyway in perl to have something show in
the error log without actually generating an error?

What I would like to be able to do is have something like

Program foo.pl started
any errors here
Program foo.pl ended

where foo.pl would put the started and ended line in the error log.

FYI these are not terminal errors I am watching for, but warnings from
pdf::api2 about invalid parameters being used

Bill H
 
Reply With Quote
 
 
 
 
Randal L. Schwartz
Guest
Posts: n/a
 
      03-13-2009
>>>>> "Bill" == Bill H <> writes:

Bill> I use tail -f to watch for errors in scripts but sometimes it is hard
Bill> to see the errors because other programmers may have scripts
Bill> generating errors. Is there anyway in perl to have something show in
Bill> the error log without actually generating an error?

Bill> What I would like to be able to do is have something like

Bill> Program foo.pl started
Bill> any errors here
Bill> Program foo.pl ended

Bill> where foo.pl would put the started and ended line in the error log.

Bill> FYI these are not terminal errors I am watching for, but warnings from
Bill> pdf::api2 about invalid parameters being used

warn "started";
....
warn "ended";


--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
 
Reply With Quote
 
 
 
 
Bill H
Guest
Posts: n/a
 
      03-13-2009
On Mar 13, 6:30*pm, Big and Blue <N...@dsl.pipex.com> wrote:
> Bill H wrote:
> > I use tail -f to watch for errors in scripts but sometimes it is hard
> > to see the errors because other programmers may have scripts
> > generating errors.

>
> Why would other programmers' scripts be generating errors on your screen?
>
> *> * * * * * * * * * *Is there anyway in perl to have something show in
>
> > the error log without actually generating an error?

>
> What error log? *Are you, by any chance, running your script on a Web server? *If so, try debugging
> the script from a terminal/command line, rather than in a Web browser (i.e. debug the logic, not the
> script).
>
> --
> * * * * * * * Just because I've written it doesn't mean that
> * * * * * * * * * *either you or I have to believe it..


HI, yeah on a web server. I have debugged it locally and in terminal
as much as possible, but now it interacts with flash and php so I have
to watch the error log to see if things did not work right.

Bill H
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      03-14-2009
Bill H <> wrote:
>On Mar 13, 6:30*pm, Big and Blue <N...@dsl.pipex.com> wrote:
>> What error log? *Are you, by any chance, running your script on a Web server? *If so, try debugging
>> the script from a terminal/command line, rather than in a Web browser (i.e. debug the logic, not the
>> script).

>
>HI, yeah on a web server. I have debugged it locally and in terminal
>as much as possible, but now it interacts with flash and php so I have
>to watch the error log to see if things did not work right.


Normally you would further test and debug the script in an isolated test
environment, exactly to prevent interference from unrelated other
programs as well as to not break the production environment with not
fully tested code.

However, if you are taking shortcuts and are pushing unfinished code
into production then just prepend all your own error and status messages
with the name of your program. Then filtering the error log for your
messages becomes trivial.

jue
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tail Call Optimization (Tail Recursion) Terry Michaels Ruby 16 04-20-2011 11:37 AM
FAQ 5.33 How do I do a "tail -f" in perl? PerlFAQ Server Perl Misc 0 03-29-2011 04:00 AM
mod_ruby/eruby & apache error_log Dmitry Maksyoma Ruby 0 05-14-2005 12:55 AM
Implementations of Multi-Methods and Tail Call Elimination (Or how I stopped worrying and learned to love decorators) Stephen Thorne Python 1 08-29-2004 11:52 PM
Swing, tail -f and threading Frank D. Greco Java 3 06-02-2004 08:16 AM



Advertisments