Logging with TYPO3 CMS and monolog

Preview:

Citation preview

Logging with TYPO3 CMS

& monolog

T3BOARD15TYPO3

Inspiring people to share

Agenda

✓ Monolog

✓ Integration in TYPO3 CMS

✓ Demo

✓ Questions?

T3BOARD15TYPO3

Inspiring people to share

Monolog

✓ Popular logging API in PHP

✓ https://github.com/Seldaek/monolog

Concepts based on

✓ Handler

✓ Processor

✓ Formatter

T3BOARD15TYPO3

Inspiring people to share

Handler

✓ Files & Syslog

✓ Send alerts & emails

✓ Email, Swiftmail, HipChat, Slack, ...

✓ Log servers & network logging

✓ AMQP, Graylog2, NewRelic, Syslogd, ...

✓ Logging in Development

✓ FirePHP, Chrome, ...

✓ Log to the Database

✓ Redis, MongoDB, CouchDB, …

✓ TYPO3 Database

Monolog

T3BOARD15TYPO3

Inspiring people to share

Processor

✓ Git information

✓ Memory

✓ Current URLS

✓ …

✓ TYPO3 Processor

Monolog

T3BOARD15TYPO3

Inspiring people to share

Formatter

✓ HTML

✓ Json

✓ Line

✓ specific Formatters

Monolog

T3BOARD15TYPO3

Inspiring people to share

TYPO3 EXT logging

✓ https://github.com/georgringer/logging

✓ Requirements

✓ PHP 5.5 => PHP 5.4

✓ CMS 7 => 6.2 LTS

Let’s take a look!

T3BOARD15TYPO3

Inspiring people to share

EXT:logging

Backend module

T3BOARD15TYPO3

Inspiring people to share

EXT:logging

Configuration I

$GLOBALS['TYPO3_CONF_VARS']['MONOLOG'] = array(

'processorConfiguration' => array(

'Monolog\\Processor\\IntrospectionProcessor' => array(),

\GeorgRinger\Logging\Log\Monolog\Processor\Typo3Processor::class =>

array(),

)

);

T3BOARD15TYPO3

Inspiring people to share

EXT:logging

Configuration II

$GLOBALS['TYPO3_CONF_VARS']['MONOLOG'] = array(

'handlerConfiguration' => array(

'name' => 'montagmorgen.at',

'handlers' => array(

\Monolog\Handler\StreamHandler::class => array(

PATH_site . 'typo3temp/out.log',

\Monolog\Logger::WARNING

),

\GeorgRinger\Logging\Log\Monolog\Handler\DatabaseHandler::class

=> array()

));

T3BOARD15TYPO3

Inspiring people to share

EXT:logging

Logging to Graylog2

T3BOARD15TYPO3

Inspiring people to share

Questions? Thanks!

inspiring people to

share.

T3BOARD15TYPO3

Inspiring people to share

Georg Ringer

✓ TYPO3 developer user since 2005

(first extension still in production!)

✓ TYPO3 CMS core developer

✓ Member of the TYPO3 Security Team

✓ working at Cyberhouse Gmbh

✓ montagmorgen.at