채택완료

php 에러 로그 확인하는 방법? ( httpd error_logs 말고)

2017-02-12 (일) 15:30:05 8,306

php 에러 로그 확인하려합니다.

<?php 

error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE); // Deprecated: Function eregi() is deprecated

ini_set('display_errors', '1');

ini_set('log_errors', '1'); // error_log 에 에러 쌓이게

와 같이 셋팅하고

tail -f /etc/httpd/logs/error_log

로는 볼 수 있지만,

/etc/httpd/logs/error_log 외에 다른 곳에 저장되게하고 싶습니다. 어떻게하면될련지요?

참고로 error_logs 셋팅해도 안됩니다.

|

답변 1개

채택된 답변
+20 포인트

ini_set("log_errors", 1); 

ini_set("error_log", "/var/www/custom-error.log");

error_log("Hello, errors!");

답변을 작성하려면 로그인이 필요합니다.