Jump to content

Php Not Saving Log Messages

Recommended Posts

I have a logmsg function in my PHP which is meant to record in a log file any errors that occur, with the time and date, the error's severity, and the line number and file name where they occurred (using __LINE__ and __FILE__). It sometimes works, but not always. Sometimes I get nothing added to the log file. Could this be to do with how PHP terminates? What happens if the logfile is not closed properly (which it won't be if there is a fatal error)? Or does some text get stuck in a buffer somewhere and never get written to the file? What can I do to make sure that any such buffers are flushed?


Thanks - Rowan

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...