Skip to content

Commit

Permalink
Fix #1778: Log only errors and delete log file on installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed May 29, 2013
1 parent 671d7c8 commit ad56e8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions install.php
Expand Up @@ -62,6 +62,12 @@ public function preflight($type, $parent) {
// Prevent installation if requirements are not met.
if (!$this->checkRequirements($manifest->version)) return false;

// Remove old log file before installation.
$logFile = JFactory::getConfig()->get('log_path').'/kunena.php';
if (file_exists($logFile)) {
@unlink($logFile);
}

return true;
}

Expand Down
5 changes: 3 additions & 2 deletions libraries/kunena/forum/forum.php
Expand Up @@ -140,8 +140,9 @@ public static function setup() {
jimport('joomla.error.log');
$options = array('logger'=>'w3c', 'text_file'=>'kunena.php');
$categories = array('kunena');
JLog::addLogger($options, JLog::ALL, $categories);

$levels = JDEBUG || $config->debug ? JLog::ALL :
JLog::EMERGENCY & JLog::ALERT & JLog::CRITICAL & JLog::ERROR;
JLog::addLogger($options, $levels, $categories);
}

/**
Expand Down

0 comments on commit ad56e8b

Please sign in to comment.