Help debug cron

This commit is contained in:
Laurent Destailleur 2022-06-03 11:52:39 +02:00
parent 41caf67ecf
commit afd9787e99
3 changed files with 17 additions and 1 deletions

View File

@ -1563,6 +1563,11 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
}
}
// Check if we have a forced suffix
if (defined('USESUFFIXINLOG')) {
$suffixinfilename .= constant('USESUFFIXINLOG');
}
if ($ident < 0) {
foreach ($conf->loghandlers as $loghandlerinstance) {
$loghandlerinstance->setIdent($ident);

View File

@ -23,6 +23,7 @@
* \ingroup cron
* \brief Execute pendings jobs
*/
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', '1'); // Disables token renewal
}
@ -42,6 +43,11 @@ if (!defined('NOIPCHECK')) {
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
}
// So log file will have a suffix
if (!defined('USESUFFIXINLOG')) {
define('USESUFFIXINLOG', '_cron');
}
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));

View File

@ -22,7 +22,7 @@
/**
* \file scripts/cron/cron_run_jobs.php
* \ingroup cron
* \brief Execute pendings jobs
* \brief Execute pendings jobs from command line
*/
if (!defined('NOTOKENRENEWAL')) {
@ -44,6 +44,11 @@ if (!defined('NOSESSION')) {
define('NOSESSION', '1');
}
// So log file will have a suffix
if (!defined('USESUFFIXINLOG')) {
define('USESUFFIXINLOG', '_cron');
}
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = __DIR__.'/';