in reply to Error Handling
If you just need to grab the error from the child script (instead of reading the log file) then my tip should help you.
Design your application to delegate the error message to somebody else. You can do it by using sockets, IPC or any other mechanism that you think fits better into your application.
For example, all scripts called by your main script will delegate the error messages by writting their respectives error messages to a different text file. The main script can check for those and send an email if necessary. This is far easier than trying to read a single log file (and probably having problems with file concurrency).
If you have access to the scripts code (and time) I would suggest you to take a look at Log4Perl module.
|
|---|