Skip to content
Extraits de code Groupes Projets
Valider ddfcd645 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Adding two new parameters:

; if set to 1, only requests done in CLI mode (eg. the archive.sh cron run) will be logged
log_only_when_cli = 0
; if set to 1, only requests with "&debug" parameter will be logged
log_only_when_debug_parameter = 0

this will make lot easier to enable debug and not mess up everything (eg. on the demo, or if piwik is heavily used by other concurrent users or via the API)

git-svn-id: http://dev.piwik.org/svn/trunk@4472 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent b0ea1eb6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -47,7 +47,7 @@ always_archive_data_range = 0;
; if set to 1, all the SQL queries will be recorded by the profiler
; and a profiling summary will be printed at the end of the request
; NOTE: you must also set [log]logger_message[] = "screen" to enable the profiler to print on screen
; NOTE: you must also set [log] logger_message[] = "screen" to enable the profiler to print on screen
enable_sql_profiler = 0
; if set to 1, a Piwik tracking code will be included in the Piwik UI footer and will track visits, pages, etc. to idsite = 1
......@@ -342,6 +342,14 @@ encryption = ; SMTP transport-layer encryption, either 'ssl', 'tls', or emp
logger_error[] = screen
logger_exception[] = screen
; if set to 1, only requests done in CLI mode (eg. the archive.sh cron run) will be logged
; NOTE: log_only_when_debug_parameter will also be checked for
log_only_when_cli = 0
; if set to 1, only requests with "&debug" parameter will be logged
; NOTE: log_only_when_cli will also be checked for
log_only_when_debug_parameter = 0
; if configured to log in files, log files will be created in this path
; eg. if the value is tmp/logs files will be created in /path/to/piwik/tmp/logs/
logger_file_path = tmp/logs
......
......@@ -49,11 +49,6 @@ abstract class Piwik_Log extends Zend_Log
$this->logToDatabaseColumnMapping = $logToDatabaseColumnMapping;
}
static public function dump($var)
{
Zend_Registry::get('logger_message')->logEvent(var_export($var, true));
}
function addWriteToFile()
{
Piwik_Common::mkdir(dirname($this->logToFileFilename));
......
......@@ -892,7 +892,20 @@ class Piwik
*/
static public function log($message = '')
{
Zend_Registry::get('logger_message')->logEvent($message);
static $shouldLog = null;
if(is_null($shouldLog))
{
$shouldLog = (Piwik_Common::isPhpCliMode()
|| Zend_Registry::get('config')->log->log_only_when_cli == 0)
&&
( Zend_Registry::get('config')->log->log_only_when_debug_parameter == 0
|| isset($_REQUEST['debug']))
;
}
if($shouldLog)
{
Zend_Registry::get('logger_message')->logEvent($message);
}
}
/**
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter