Commit d5312e8b authored by Carsten  Rose's avatar Carsten Rose

Fixes #8856. AutoCron: SQL logMode should be defined separately

parent d7dfe24d
......@@ -399,10 +399,12 @@ Extension Manager: QFQ Configuration
| redirectAllMailTo | john@doe.com | If set, redirect all QFQ generated mails (Form, Report) to the specified. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| sqlLogMode | modify | | *all*: every statement will be logged - this might a lot. |
| | | | *modify*: log only statements who change data. *error*: log only |
| | | DB errors. |
| | | | *modify*: log only statements who change data. |
| | | | *error*: log only DB errors. |
| | | | *none*: no SQL log at all. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| sqlLogModeAutoCron | error | Applies only to AutoCron Jobs. For production 'error' should be fine. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| sqlLog | fileadmin/protected/log/sql.log | Filename to log SQL commands: relative to <site path> or absolute. If the |
| | | directory does not exist, create it. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
......
......@@ -504,6 +504,7 @@ const SYSTEM_MAIL_LOG_FILE = 'fileadmin/protected/log/mail.log';
const SYSTEM_SQL_LOG = 'sqlLog'; // Logging to file
const SYSTEM_SQL_LOG_FILE = 'fileadmin/protected/log/sql.log';
const SYSTEM_SQL_LOG_MODE = 'sqlLogMode'; // Mode, which statements to log.
const SYSTEM_SQL_LOG_MODE_AUTOCRON = 'sqlLogModeAutoCron'; // Mode, which statements to log in AutoCron Environments.
const SYSTEM_FORM_SUBMIT_LOG_MODE = 'formSubmitLogMode';
const FORM_SUBMIT_LOG_MODE_ALL = 'all';
......
......@@ -318,6 +318,7 @@ class Config {
SYSTEM_QFQ_LOG => SYSTEM_QFQ_LOG_FILE,
SYSTEM_SQL_LOG => SYSTEM_SQL_LOG_FILE,
SYSTEM_SQL_LOG_MODE => 'modify',
SYSTEM_SQL_LOG_MODE_AUTOCRON => 'error',
F_BS_COLUMNS => 'col-md-12 col-lg-10',
F_BS_LABEL_COLUMNS => 'col-md-3 col-lg-3',
F_BS_INPUT_COLUMNS => 'col-md-6 col-lg-6',
......
......@@ -8,14 +8,14 @@
namespace IMATHUZH\Qfq\External;
use IMATHUZH\Qfq\Core\Store\Store;
use IMATHUZH\Qfq\Core\Database\Database;
use IMATHUZH\Qfq\Core\Evaluate;
use IMATHUZH\Qfq\Core\Report\SendMail;
use IMATHUZH\Qfq\Core\Helper\Support;
use IMATHUZH\Qfq\Core\Helper\Logger;
use IMATHUZH\Qfq\Core\Helper\DownloadPage;
use IMATHUZH\Qfq\Core\Helper\Logger;
use IMATHUZH\Qfq\Core\Helper\Support;
use IMATHUZH\Qfq\Core\Report\SendMail;
use IMATHUZH\Qfq\Core\Store\Store;
/**
* Class AutoCron
......@@ -68,6 +68,10 @@ class AutoCron {
$this->store = Store::getInstance();
// Set Log Mode for AutoCron updates
$sqlLogMode = $this->store->getVar(SYSTEM_SQL_LOG_MODE_AUTOCRON, STORE_SYSTEM);
$this->store->setVar(SYSTEM_SQL_LOG_MODE, $sqlLogMode, STORE_SYSTEM);
$this->dbIndexQfq = $this->store->getVar(SYSTEM_DB_INDEX_QFQ, STORE_SYSTEM);
$this->dbArray[$this->dbIndexQfq] = new Database($this->dbIndexQfq);
......
......@@ -65,6 +65,9 @@ redirectAllMailTo =
# cat=debug/sql; type=string; label=SQL log mode:Default is 'modify'. A logfile of QFQ fired SQL statements will be written. Possible modes are 'all' - every statement will be logged (this might a lot). 'modify' - log only statements who change data. 'error' - log only DB errors. 'none' - log never.
sqlLogMode = modify
# cat=debug/sql; type=string; label=SQL log mode for AutoCron:Default is 'error'. Modes see 'sqlLogMode'.
sqlLogModeAutoCron = error
# cat=debug/sql; type=string; label=SQL log file:Default is 'fileadmin/protected/log/sql.log'. A logfile of fired SQL statements. PathFile is absolute or relative to '<site path>'.
sqlLog = fileadmin/protected/log/sql.log
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment