thomascube
2008-09-02 ade8e117dfbb62f6dbd16b4aca81dfbdbd054579
program/include/bugs.inc
@@ -66,7 +66,7 @@
 */
function log_bug($arg_arr)
{
  global $CONFIG, $INSTALL_PATH;
  global $CONFIG;
  $program = $arg_arr['type']=='xpath' ? 'XPath' : strtoupper($arg_arr['type']);
  // write error to local log file
@@ -81,11 +81,16 @@
      $arg_arr['line']);
                 
    if (empty($CONFIG['log_dir']))
      $CONFIG['log_dir'] = $INSTALL_PATH.'logs';
      $CONFIG['log_dir'] = INSTALL_PATH.'logs';
      
    // try to open specific log file for writing
    if ($fp = @fopen($CONFIG['log_dir'].'/errors', 'a'))
    if ($CONFIG['log_driver'] == 'syslog')
    {
      syslog(LOG_ERR, $log_entry);
    }
    else if ($fp = @fopen($CONFIG['log_dir'].'/errors', 'a'))
    {
      // log_driver == 'file' is the default, assumed here.
      fwrite($fp, $log_entry);
      fclose($fp);
    }