Skip to content

Instantly share code, notes, and snippets.

@prappo
Last active January 13, 2025 18:56
Show Gist options
  • Save prappo/894fb83f6ffcce95138167c4fdaa3113 to your computer and use it in GitHub Desktop.
Save prappo/894fb83f6ffcce95138167c4fdaa3113 to your computer and use it in GitHub Desktop.
Enable WordPress debugging and map debug.log file for wp-env
{
"plugins": ["."],
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"SCRIPT_DEBUG": true,
"WP_DEBUG_DISPLAY": true,
"WP_PHP_BINARY": "php"
},
"mappings": {
"wp-content/debug.log": "./debug.log"
}
}
@greenworld
Copy link

Thank you for a useful config snippet

Mapping is not working properly for me (directory ./debug.log is created instead of file) to fix need to remove folder and create locally file ./debug.log with appropriate permissions

@lbonomo
Copy link

lbonomo commented Dec 29, 2024

I had the same issue

@lbonomo
Copy link

lbonomo commented Jan 13, 2025

Hi @greenworld, I use another way to fix it

    "config": {
        "WP_DEBUG": true,
        "WP_DEBUG_DISPLAY": true,
        "SCRIPT_DEBUG": false,
        "WP_DEBUG_LOG": "/var/www/html/wp-content/plugins/[plugin-slug]/debug.log"
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment