LoginSignup
4
4

More than 5 years have passed since last update.

WordPressで、エラー表示を画面に表示せずに、ログに出力する方法

Posted at

WordPressで、画面にエラー表示をさせずに、ログに出力する方法は以下の設定をwp-config.phpに記述することで実現出来ます。

※define('WP_DEBUG_LOG', true);を記述することで、WP_CONTENT_DIR . '/debug.log'にエラー出力することが出来ますが、ログが分散するのが嫌なので、それはやらずに、通常のログファイルに出力します。

ini_set('display_errors', 0);
ini_set("log_errors", 1);
ini_set("error_log", "/var/log/nginx/error.log");
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4