Jump to content

Error logging


runnerjp

Recommended Posts

Hi,

 

I need to create a PHP script that writes php errors (Warning notices etc.) to  MySQLdatabase. I know PHP has a built in error log function but im on a shared hosting site and cant chnage these types of files nor have any access ot them. Any ideas where I could start?

 

I already have error reporting enabled at the start of my scripts,

 

PHP Code:

<?php
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
?>

 

The data i was thinkin of is:

Date/time

Page

error

Error line in code?

Ip of user

username

 

then if an error is added to db send me an email so i know.

 

Then rather then disply " there is an error in you syntax" ect it just prompts them to an error page of my own choosing.

 

This way i wont show information which could lead to security holes!

 

 

Thanks!

 

Jarratt.

Link to comment
https://forums.phpfreaks.com/topic/196412-error-logging/
Share on other sites

I need to create a PHP script that writes php errors (Warning notices etc.) to  MySQLdatabase. I know PHP has a built in error log function but im on a shared hosting site and cant chnage these types of files nor have any access ot them.

 

The location of your error log can be set quite simply within a .htaccess file or via ini_set. Obviously you didn't check the manual before posting this uneducated comment.

Link to comment
https://forums.phpfreaks.com/topic/196412-error-logging/#findComment-1031258
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.