Project

General

Profile

Actions

Bug #95927

closed

scheduler task (TestTask) is not logging /creating log entries when executed (v10 and v11)

Added by Marco H about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
-- undefined --
Assignee:
-
Category:
scheduler
Target version:
Start date:
2021-11-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
scheduler log logging
Complexity:
Is Regression:
Sprint Focus:

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?

Actions #1

Updated by Georg Ringer about 3 years ago

  • TYPO3 Version changed from 11 to 10
Actions #2

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?

Actions #3

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.

Actions #4

Updated by Georg Ringer about 3 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF