Help us understand the problem. What is going on with this article?

WordPressのデバッグモード(ログ出力)

More than 5 years have passed since last update.

プラグインを作成していたのでメモ。
WordPressをインストールしたディレクトリ直下にあるwp-config.php 内の定数「WP_DEBUG」をtrueにします。

define('WP_DEBUG', true); // デバッグモードを有効化

// ログファイルに保存する場合は、以下を書き足します。
if ( WP_DEBUG ) {
    // debug.log ファイルに記録
    define( 'WP_DEBUG_LOG', true );
    // ブラウザ上に表示しない
    define( 'WP_DEBUG_DISPLAY', false );
    // ブラウザ上に表示しない
    @ini_set( 'display_errors',0 );
}

/wp_content/debug.log に記録されます。
以下のような感じで記録されます。

[19-May-2014 05:25:00 UTC] PHP Notice:  load_plugin_textdomain was called with an argument that is <strong>deprecated</strong> since version 2.7 with no alternative available. in /home/programp/www/blog/wp-includes/functions.php on line 3195
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした