---
title: "Deprecation: #109295 - DatabaseWriter::setLogTable()/getLogTable()"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-109295-1742407200"
source: "Changelog/14.2/Deprecation-109295-DatabaseWriterSetLogTableGetLogTable.rst"
typo3-version: "14.2"
typo3-major: 14
type: "deprecation"
issue: 109295
forge: "https://forge.typo3.org/issues/109295"
tags: ["PHP-API", "PartiallyScanned", "ext:core"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Deprecation: #109295 - DatabaseWriter::setLogTable()/getLogTable() {#deprecation-109295-1742407200}

See [forge#109295](https://forge.typo3.org/issues/109295)

## Description {#description}

The methods `setLogTable()` and `getLogTable()` in
`\TYPO3\CMS\Core\Log\Writer\DatabaseWriter` have been deprecated.

`DatabaseWriter` is a dedicated writer
for the `sys_log` table. Its `writeLog()` method maps
`LogRecord` fields to the `sys_log`
schema (`request_id`, `time_micro`, `component`,
`level`, `message`, `data`, `tstamp`). Allowing an
arbitrary table to be set via `setLogTable()` created a false sense of
flexibility - any custom table needs to replicate the full
`sys_log` schema to work correctly.

The long-term goal is to make
`DatabaseWriter` `final` and to
remove the `$logTable` property entirely.

## Impact {#impact}

Calling `setLogTable()` or `getLogTable()` triggers a PHP
`E_USER_DEPRECATED` error. This also includes passing
`logTable` as a configuration option when
`DatabaseWriter` is registered via
`$GLOBALS['TYPO3_CONF_VARS']['LOG']`, since the
`AbstractWriter` constructor resolves options to `set*()` calls.

Support will be removed in TYPO3 v15.0.

## Affected installations {#affected-installations}

Installations that configure
`DatabaseWriter` with a custom
`logTable` option, or that call `setLogTable()` or
`getLogTable()` on a
`DatabaseWriter` instance.

The extension scanner detects direct calls to `->setLogTable()` and
`->getLogTable()`. The more common case, passing `logTable` as a
configuration option via `$GLOBALS['TYPO3_CONF_VARS']['LOG']`, cannot
be detected automatically and requires a manual search for
`DatabaseWriter` usage with a
`logTable` key.

## Migration {#migration}

Replace `DatabaseWriter` with a
dedicated writer that extends
`\TYPO3\CMS\Core\Log\Writer\AbstractWriter` and implements
`writeLog()` with explicit field mapping for the custom table.

Before:

```php
use Psr\Log\LogLevel;
use TYPO3\CMS\Core\Log\Writer\DatabaseWriter;

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][LogLevel::WARNING] =
[
    DatabaseWriter::class => ['logTable' => 'my_custom_log'],
];
```

After:

**EXT:my_extension/Classes/Log/Writer/MyCustomTableWriter.php**

```php
namespace MyVendor\MyExtension\Log\Writer;

use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Log\LogRecord;
use TYPO3\CMS\Core\Log\Writer\AbstractWriter;
use TYPO3\CMS\Core\Log\Writer\WriterInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class MyCustomTableWriter extends AbstractWriter
{
    public function writeLog(LogRecord $record): WriterInterface
    {
        GeneralUtility::makeInstance(ConnectionPool::class)
            ->getConnectionForTable('my_custom_log')
            ->insert('my_custom_log', [
                'created' => (int)$record->getCreated(),
                'level' => $record->getLevel(),
                'message' => $record->getMessage(),
            ]);
        return $this;
    }
}
```

```php
use Psr\Log\LogLevel;
use MyVendor\MyExtension\Log\Writer\MyCustomTableWriter;

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][LogLevel::WARNING] = [
    MyCustomTableWriter::class => [],
];
```
