Bug #95927
closedscheduler task (TestTask) is not logging /creating log entries when executed (v10 and v11)
0%
Description
I've had this issue in TYPO3 10.4 and 11.5
The Test Task (sysext\scheduler\Classes\Example\TestTask.php) in scheduler sends an email, it should also create a log entry while doing so:
10.4$this->logger->info('[TYPO3\\CMS\\Scheduler\\Example\\TestTask]: Test email sent to "' . $this->email . '"');
11.5$this->logger->info('[TYPO3\\CMS\\Scheduler\\Example\\TestTask]: Test email sent to "{email}"', ['email' => $this->email]);
However, the backend log module doesn't show this log entry.
The log is working, it shows logs like "Scheduler task "Scheduler test task" (UID: 1, Class: "TYPO3\CMS\Scheduler\Example\TestTask") was added" or "User xxx logged in from 0.0.0.0"
Am I missing something?
Updated by Georg Ringer about 3 years ago
- Status changed from New to Needs Feedback
The logging framework (See https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Logging/Index.html for more information) does not automatically log into the database (which you know from the log backend module).
if you either change the ->info
to ->warning
in the TestTask
or adopt the configuration in the LocalConfiguration
or AdditionalConfiguration
you will get an entry in var/log/typo3_*****.log like
Wed, 10 Nov 2021 16:12:27 +0100 [WARNING] request="e1ec9048982ac" component="TYPO3.CMS.Scheduler.Task.AbstractTask": [TYPO3\CMS\Scheduler\Example\TestTask]: Test email sent to "fo@bar.com" - {"email":"fo@bar.com"}
does this information help and can I close the issue?
Updated by Marco H about 3 years ago
- Priority changed from Should have to -- undefined --
Oh, you're right. I wasn't aware that the logs are independent from each other.
So it was my fault - you can close this, thank you for the explanation.
Updated by Georg Ringer about 3 years ago
- Status changed from Needs Feedback to Closed