Story #48874

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

Added by Steffen Müller over 5 years ago. Updated over 5 years ago.

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


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 severityResolved

Task #48877: PSR-3: Cast log message to stringResolved

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

Task #48880: Implement LoggerInterface from PSR-3Resolved

Task #48881: PSR-3: Support log severities of type stringResolved

Related issues

Related to TYPO3 Core - Task #49661: Mention PSR-3 Logger compatibility in News.txt Closed 2013-07-04
Related to TYPO3.Flow - Feature #49039: RFC: Use PSR-3 logger interface in Flow New 2013-06-11


#1 Updated by Ernesto Baschny over 5 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).

#2 Updated by Steffen Müller over 5 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

#3 Updated by Steffen Müller over 5 years ago

  • Status changed from New to Accepted

#4 Updated by Steffen Müller over 5 years ago

  • Status changed from Accepted to Resolved

Also available in: Atom PDF