Commit a299ef29 authored by Carsten  Rose's avatar Carsten Rose Committed by Carsten Rose
Browse files

B5884: sql.log public readable. Default is now changed from typo3conf/sql.log...

B5884: sql.log public readable. Default is now changed from typo3conf/sql.log to fileadmin/protected/log/sql.log|mail.log
parent de14d11e
......@@ -51,11 +51,11 @@ fillStoreSystemBySqlErrorMsg3 =
# 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 file:Default is 'typo3conf/sql.log'. A logfile of fired SQL statements. PathFile is absolute or relative to '<site path>'.
sqlLog = typo3conf/sql.log
# 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
# cat=debug/mail; type=string; label=Mail log file:Default is 'typo3conf/mail.log'. A logfile of sent mail. PathFile is absolute or relative to '<site path>'.
mailLog = typo3conf/mail.log
# cat=debug/mail; type=string; label=Mail log file:Default is 'fileadmin/protected/log/mail.log'. A logfile of sent mail. PathFile is absolute or relative to '<site path>'.
mailLog = fileadmin/protected/log/mail.log
# cat=debug/info; type=string; label=Show debug info:Default is 'auto'. Possible values: [yes|no|auto][,download]. For 'auto': If a BE User is logged in, a debug information will be shown on the FE.
showDebugInfo = auto
......
......@@ -14,6 +14,7 @@ const CONFIG_T3 = 'LocalConfiguration.php'; // T3 config file
const GFX_INFO = 'typo3conf/ext/qfq/Resources/Public/icons/note.gif';
const API_DIR = 'typo3conf/ext/qfq/qfq/api';
const QFQ_LOG_DIR = 'fileadmin/protected/log';
const QFQ_LOG = 'qfq.log';
const QFQ_TEMP_FILE_PATTERN = 'qfq.split.XXXXX';
const QFQ_TEMP_SOURCE = '.temp.source';
......
......@@ -34,6 +34,7 @@ class File {
* @param bool|false $phpUnit
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public function __construct($phpUnit = false) {
$this->session = Session::getInstance($phpUnit);
......
......@@ -10,6 +10,7 @@ namespace qfq;
require_once(__DIR__ . '/../Constants.php');
require_once(__DIR__ . '/../exceptions/UserFormException.php');
require_once(__DIR__ . '/../helper/Support.php');
/**
* Class Logger
......@@ -33,15 +34,22 @@ class Logger {
}
if (!$handle = fopen($filename, $mode)) {
throw new UserFormException("Error - cannot open. File: " . $filename . " ( CWD: " . getcwd() . ")", ERROR_IO_OPEN);
// If open fails, maybe die directory does not exist. Create it:
Support::mkDirParent($filename);
// Try to open the file a second time.
if (!$handle = fopen($filename, $mode)) {
throw new UserFormException("Error - cannot open. File: " . $filename . " ( CWD: " . getcwd() . ") - " . error_get_last(), ERROR_IO_OPEN);
}
}
if (fwrite($handle, $msg . PHP_EOL) === false) {
throw new UserFormException("Error - cannot write. File: " . $filename . " ( CWD: " . getcwd() . ")", ERROR_IO_WRITE);
throw new UserFormException("Error - cannot write. File: " . $filename . " ( CWD: " . getcwd() . ") - " . error_get_last(), ERROR_IO_WRITE);
}
fclose($handle);
} // logMessage()
}
/**
* @param array $fe
......
Supports Markdown
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