Title: Please stop overwriting PHP ini &#8216;error_log&#8217; value
Last modified: August 19, 2020

---

# Please stop overwriting PHP ini ‘error_log’ value

 *  Resolved [WP Wham](https://wordpress.org/support/users/wpwham/)
 * (@wpwham)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/please-stop-overwriting-php-ini-error_log-value/)
 * Hi there,
 * I love your plugin, but it does one thing very frustrating… it overwrites my 
   PHP ini value for ‘error_log’. The problem is in the file `translatepress-multilingual/
   includes/class-translation-render.php` where you have:
 *     ```
       /**
        * Function to hide php errors and notice and instead log them in debug.log so we don't store the notice strings inside the db if WP_DEBUG is on
        */
       public function trp_debug_mode_off(){
           if ( WP_DEBUG ) {
               ini_set('display_errors', 0);
               ini_set('log_errors', 1);
               ini_set('error_log', WP_CONTENT_DIR . '/debug.log');
           }
       }
       ```
   
 * When I’m in debug mode (and on my development environments I always have WP_DEBUG
   enabled), this forces the error_log location to be `WP_CONTENT_DIR . '/debug.
   log'`. I don’t want this. I have a different setting for `error_log`, and I want
   to keep it that way… but as long as Translatepress is active it’s impossible.
 * I understand from the comment that you “don’t store the notice strings inside
   the db if WP_DEBUG is on”, but it is not necessary to change the value of ‘error_log’
   to achieve this. I think setting ‘display_errors’ to 0 is enough already.
 * Please consider this and respect users who have different values for their ‘error_log’
   location.
 * Best regards,
    David Grant Lead Developer WP Wham

Viewing 1 replies (of 1 total)

 *  [Denis](https://wordpress.org/support/users/sdenis/)
 * (@sdenis)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/please-stop-overwriting-php-ini-error_log-value/#post-13285673)
 * Hello David,
 * Please add the following in functions.php of the theme or create a new plugin
   with this code in it:
 *     ```
       // Disable redirecting error logs to wp-content directory
       add_action( 'trp_before_running_hooks', 'trpc_remove_hook_that_redirects_error_logs', 10, 1);
       function trpc_remove_hook_that_redirects_error_logs( $trp_loader ){
           $trp                = TRP_Translate_Press::get_trp_instance();
           $translation_render = $trp->get_component( 'translation_render' );
           $trp_loader->remove_hook( 'init', 'trp_debug_mode_off', $translation_render );
       }
       ```
   
 * Kind regards,
    Denis
    -  This reply was modified 5 years, 9 months ago by [Denis](https://wordpress.org/support/users/sdenis/).

Viewing 1 replies (of 1 total)

The topic ‘Please stop overwriting PHP ini ‘error_log’ value’ is closed to new replies.

 * ![](https://ps.w.org/translatepress-multilingual/assets/icon.svg?rev=3166541)
 * [TranslatePress - Translate Multilingual sites with AI Translation](https://wordpress.org/plugins/translatepress-multilingual/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/translatepress-multilingual/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/translatepress-multilingual/)
 * [Active Topics](https://wordpress.org/support/plugin/translatepress-multilingual/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/translatepress-multilingual/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/translatepress-multilingual/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Denis](https://wordpress.org/support/users/sdenis/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/please-stop-overwriting-php-ini-error_log-value/#post-13285673)
 * Status: resolved