The purpose of a log writer is (usually) to save all log records into a persistent storage, like a log file, a database table, or to a remote syslog server.
Different log writers offer possibilities to log into different targets. Custom log writers can extend the functionality shipped with TYPO3 core.
Built-in Log Writers¶
This section describes the log writers shipped with the TYPO3 core. Some writers have options to allow customization of the particular writer. See the Configuration section for how to use these options.
The database writer logs into a database table. This table has to reside in the database used by TYPO3 and is not automatically created.
The Admin Tools > Log module is not adapted to the records written by the
DatabaseWriter into the
sys_log table. If you write such records
there, you will not be able to see them using that module. A tool for viewing
such records in the TYPO3 backend is currently missing.
The file writer logs into a log file, one log record per line.
If the log file does not exist, it will be created (including parent directories, if needed).
Please make sure that your web server has write-permissions to that path
and it is below the root directory of your web site (defined by
PATH_site). The filename is
appended with a hash, that depends on the encryption key.
$GLOBALS['TYPO3_CONF_VARS']['SYS']['generateApacheHtaccess'] is set,
.htaccess file is added to the directory.
It protects your log files from being accessed from the web.
|logFile||no||Path to log file||
Logs into the syslog (Unix only).
|facility||no||Syslog Facility to log into.||
Custom Log Writers¶
Custom log writers can be added through extensions.
Every log writer has to implement the interface
It is suggested to extend the abstract class
which allows you use configuration options by adding the corresponding properties and setter methods.
Please keep in mind that TYPO3 will silently continue operating,
in case a log writer is throwing an exception while executing the
Only in the case that all registered writers fail, the log entry plus additional information
will be added to the configured fallback logger (which defaults to
the PhpErrorLog writer).