Plugin Name: Private Debug Log
Description: Enable debug log to a private folder not accessible from the web
Author URI: http://www.webaware.com.au/
copyright (c) 2013 WebAware Pty Ltd (email : email@example.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Edit the location of $debuglog to specify a folder outside your website root, inaccessible to web browsers.
Some common folder names are 'private', '_private', 'tmp'
// for testing, will put debug log in folder wp-content/uploads
//~ $debuglog = WP_CONTENT_DIR . '/uploads';
// put debug log in folder ../private (i.e. outside the web root)
$debuglog = dirname(ABSPATH) . '/private';
ini_set('error_log', $debuglog . '/debug.log');
error_log(basename(__FILE__) . ': if you can read this, close enough.');