jscix Posted April 8, 2007 Share Posted April 8, 2007 I'm not sure if this is possible, but what I'm curious about is, Is it possible to modify/redefine how a php command such as DIE works? What I would like to do is have the die command also save the text to a log file, is this possible ? eg: die ("Error",$logfilename); anyone? : Quote Link to comment Share on other sites More sharing options...
Dragen Posted April 8, 2007 Share Posted April 8, 2007 why not just right a function to do what you need? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 8, 2007 Share Posted April 8, 2007 You can change the way how die works if you wish. However you will need to know C (or what ever programming language PHP is programmed in). However what I'd do is create a function that will log the error passed to it example die(log_error('error message here', $errorLog); Quote Link to comment Share on other sites More sharing options...
jscix Posted April 8, 2007 Author Share Posted April 8, 2007 ah that is a really good idea. Thank you wild. The reason I asked is I have already done a large amount of work, before deciding that logging errors would end up saving me a whole lot of work later on when something goes wrong/breaks.. So being lazy as I am, I wanted a quick fix so I didn't have to replace all the die commands with a modified version. :/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.