Application logging

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ngungo
Forum Commoner
Posts: 75
Joined: Thu Jun 08, 2006 10:45 pm

Application logging

Post by ngungo »

I would like to direct all application errors to a log file, /home/mysite.com/logs/myapp_log and prevent them display to the standard output (screen) so I do this:

Code: Select all

 
error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", "Off");
ini_set("log_errors", "On");
ini_set("error_log", "/home/mysite.com/logs/myapp_log");
 
It still displays to the standard out and not to the file. Did I do it wrongly?

Thanks,
ngungo
pkbruker
Forum Commoner
Posts: 32
Joined: Sun Aug 03, 2008 9:36 am
Location: Oslo, Norway

Re: Application logging

Post by pkbruker »

Try replacing the first line with:

Code: Select all

 
error_reporting(0);
 
Post Reply