---
title: "Configuration of the logging system"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:logging-configuration@main"
source: "ApiOverview/Logging/Configuration/Index.rst"
rendered: "2026-09-19T06:56:03+00:00"
---

# Configuration of the logging system {#logging-configuration}

The instantiation of [loggers](https://docs.typo3.org/permalink/t3coreapi:logging-logger@main) is configuration-free, as
the log manager automatically applies its configuration.

The logger configuration is read from `$GLOBALS['TYPO3_CONF_VARS']['LOG']`,
which contains an array reflecting the namespace and class hierarchy of your
TYPO3 project.

> [!NOTE]
> **See also**
>
> Are you configuring logging for a live TYPO3 instance?
> See [Logging considerations during production](https://docs.typo3.org/permalink/t3coreapi:production-logging@main) for best practices on logging in production
> environments, including log rotation, log levels, file storage, and
> monitoring tools like Sentry.

For example, to apply a configuration for all loggers within the
`\TYPO3\CMS\Core\Cache` namespace, the configuration is read from
`$GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['Core']['Cache']`.
So every logger requested for classes like `\TYPO3\CMS\Core\Cache\CacheFactory`,
`\TYPO3\CMS\Core\Cache\Backend\NullBackend`, etc. will get this
configuration applied.

Configuring the logging for extensions works the same.

## Writer configuration {#logging-configuration-writer}

The [log writer](https://docs.typo3.org/permalink/t3coreapi:logging-writers@main) configuration is read from the sub-key
`writerConfiguration` of the configuration array:

**config/system/additional.php | typo3conf/system/additional.php**

```php
<?php

use Psr\Log\LogLevel;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Log\Writer\FileWriter;

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'] = [
  // Configuration for ERROR level log entries
  LogLevel::ERROR => [
    // Add a FileWriter
    FileWriter::class => [
      // Configuration for the writer
      'logFile' => Environment::getVarPath()
          . '/log/typo3_7ac500bce5.log',
    ],
  ],
];

```

The above configuration applies to **all** log entries of level "ERROR" or above.

> [!NOTE]
> The default folder for log files is `<var-path>/log`.
> The `<var-path>` is `<project-root>/var/` for Composer-based
> installations and `typo3temp/var/` for Classic mode installations.

To apply a special configuration for the controllers of the *examples* extension,
use the following configuration:

**config/system/additional.php | typo3conf/system/additional.php**

```php
<?php

use Psr\Log\LogLevel;
use TYPO3\CMS\Core\Log\Writer\SyslogWriter;

$GLOBALS['TYPO3_CONF_VARS']['LOG']['T3docs']['Examples']['Controller']
    ['writerConfiguration'] = [
      // Configuration for WARNING severity, including all
      // levels with higher severity (ERROR, CRITICAL, EMERGENCY)
      LogLevel::WARNING => [
        // Add a SyslogWriter
        SyslogWriter::class => [],
      ],
    ];

```

This overwrites the default configuration shown in the first example for classes
located in the namespace `\T3docs\Examples\Controller`.

One more example:

**config/system/additional.php | typo3conf/system/additional.php (excerpt)**

```php
<?php

// Configure logging ...

// For class \T3docs\Examples\Controller\FalExampleController
$GLOBALS['TYPO3_CONF_VARS']['LOG']
    ['T3docs']['Examples']['Controller']['FalExampleController']
    ['writerConfiguration'] = [
      // ...
    ];

// For channel "security"
$GLOBALS['TYPO3_CONF_VARS']['LOG']['security']['writerConfiguration'] = [
  // ...
];

```

For more information about channels, see [Channels](https://docs.typo3.org/permalink/t3coreapi:logging-channels@main).

An arbitrary number of writers can be added for every severity level (INFO,
WARNING, ERROR, ...). The configuration is applied to log entries of the
particular severity level plus all levels with a higher severity. Thus, a log
message created with `$logger->warning()` will be affected by the
writer configuration for the log levels:

-   `LogLevel::DEBUG`
-   `LogLevel::INFO`
-   `LogLevel::NOTICE`
-   `LogLevel::WARNING`

For the above example code that means:

-   Calling `$logger->warning($msg);` will result in `$msg` being
    written to the computer's syslog on top of the default configuration.
-   Calling `$logger->debug($msg);` will result in `$msg` being
    written only to the default log file (`var/log/typo3_<hash>.log`).

For a list of writers shipped with the TYPO3 Core see the section about
[Log writers](https://docs.typo3.org/permalink/t3coreapi:logging-writers@main).

## Processor configuration {#logging-configuration-processor}

Similar to the writer configuration, [log record processors](https://docs.typo3.org/permalink/t3coreapi:logging-processors@main)
can be configured on a per-class and per-namespace basis with the sub-key
`processorConfiguration`:

**config/system/additional.php | typo3conf/system/additional.php**

```php
<?php

use Psr\Log\LogLevel;
use TYPO3\CMS\Core\Log\Processor\MemoryUsageProcessor;

$GLOBALS['TYPO3_CONF_VARS']['LOG']['T3docs']['Examples']['Controller']
    ['processorConfiguration'] = [
      // Configuration for ERROR level log entries
      LogLevel::ERROR => [
        // Add a MemoryUsageProcessor
        MemoryUsageProcessor::class => [
          'formatSize' => true,
        ],
      ],
    ];

```

For a list of processors shipped with the TYPO3 Core, see the section about
[Log processors](https://docs.typo3.org/permalink/t3coreapi:logging-processors@main).

## Disable all logging {#logging-configuration-disable}

In some setups it is desirable to disable all logs and to only enable them on demand.
You can disable all logs by unsetting `$GLOBALS['TYPO3_CONF_VARS']['LOG']` at the
end of your [additional.php](https://docs.typo3.org/permalink/t3coreapi:typo3confvars-additional@main):

**config/system/additional.php | typo3conf/system/additional.php**

```php
// disable all logging
unset($GLOBALS['TYPO3_CONF_VARS']['LOG']);
```

You can then temporarily enable logging by commenting out this line:

**config/system/additional.php | typo3conf/system/additional.php**

```php
// unset($GLOBALS['TYPO3_CONF_VARS']['LOG']);
// By commenting out the line above you can enable logging again.
```
