Story #48874

As a developer I want a PSR-3 compatible Logging API

Added by Steffen Müller about 9 years ago. Updated about 9 years ago.

Could have
Logging API
Start date:
Due date:
% Done:


Estimated time:
(Total: 0.00 h)
TYPO3 Version:


PSR-3 aims to set a standard for Logging in PHP.

Adapting this standard for the Logging API on TYPO3 would allow developers to replace the core Logging implementation with any other PSR-3 compatible logger (given the necessary dependency injection is in place).
It also would ease the understanding how to log in TYPO3.


Task #48876: PSR-3: throw InvalidArgumentException on undefined severityResolved2013-06-05

Task #48877: PSR-3: Cast log message to stringResolved2013-06-05

Task #48879: PSR-3: Validate reserved array key "exception" in LogRecord->dataClosed2013-06-05

Task #48880: Implement LoggerInterface from PSR-3Resolved2013-06-05

Task #48881: PSR-3: Support log severities of type stringResolved2013-06-05


Related issues

Related to TYPO3 Core - Task #49661: Mention PSR-3 Logger compatibility in News.txtClosed2013-07-04

Related to TYPO3.Flow - Feature #49039: RFC: Use PSR-3 logger interface in FlowNew2013-06-11


Updated by Ernesto Baschny about 9 years ago

In my understanding the major benefit of implementing a PSR-3 compatible interface in TYPO3 is not to "allow developers to replace the core Logging implementation", but to allow third party modules/packages which log to PSR-3 to be integrated into TYPO3 without modification (simply injecting the PSR-3 Logging Interface from TYPO3 into it).

From the Standard:

"The main goal is to allow libraries to receive a Psr\Log\LoggerInterface object and write logs to it in a simple and universal way."

The easiest way would be to provide an adapter which implements this interface and under the hood uses the (more sophisticated) TYPO3 API. TYPO3 Core could still use TYPO3's own API (which provides more flexibility).


Updated by Steffen Müller about 9 years ago

I don't think we need adapter, since TYPO3\CMS\Core\Log\Logger already meets the requirements of Psr\Log\LoggerInterface (except for some minor glitches as addressed in the subtasks). See #48880 and #48881


Updated by Steffen Müller about 9 years ago

  • Status changed from New to Accepted

Updated by Steffen Müller about 9 years ago

  • Status changed from Accepted to Resolved

Also available in: Atom PDF