original_string: public function save($log_dir = '')
      {
          if (empty($log_dir)) {
              $log_dir = \ROOT . '/private/logs/syslog/';
          }
  
          if (!is_dir($log_dir)) {
              mkdir($log_dir, 0777, true);
          }
  
          return file_put_contents($log_dir . date('Y_m_d') . '.log',
                  $this->message . "\n", \FILE_APPEND);
      }
code: public function save($log_dir = '')
      {
          if (empty($log_dir)) {
              $log_dir = \ROOT . '/private/logs/syslog/';
          }
  
          if (!is_dir($log_dir)) {
              mkdir($log_dir, 0777, true);
          }
  
          return file_put_contents($log_dir . date('Y_m_d') . '.log',
                  $this->message . "\n", \FILE_APPEND);
      }
code_tokens: public function save ( $ log_dir = '' ) { if ( empty ( $ log_dir ) ) { $ log_dir = \ ROOT . '/private/logs/syslog/' ; } if ( ! is_dir ( $ log_dir ) ) { mkdir ( $ log_dir , 0777 , true ) ; } return file_put_contents ( $ log_dir . date ( 'Y_m_d' ) . '.log' , $ this -> message . "\n" , \ FILE_APPEND ) ; }
docstring: Saves data to local logs dir when syslog server is not available
  @param string $log_dir The log dir the data is written to
  @param string $log_type The log_type being written to
  @return boolean If the data was written or not
docstring_tokens: Saves data to local logs dir when syslog server is not available