Logar Erros PHP

1 – Altere as entradas abaixo em /etc/php.ini

log_errors = On
error_log = /var/log/php_errors.log

2 – Teste

php -r "error_log('123');"
more /var/log/php_errors.log

3 – Adicionando entrada ao logrotate ( opcional )

vi /etc/logrotate.d/php-cli

/var/log/php_errors.log {
  weekly
  missingok
  rotate 13
  compress
  delaycompress
  copytruncate
  notifempty
  create 664 root www-users
  sharedscripts
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s