# Logging

This application template uses a logger monolog/monolog. You can easily change it to your preferred PSR-3 implementation.

By default, logs are written to the file var/logs/app.log. The file path can be changed in config/config.php. You can also change the log storage to a database or something else by changing the App\Infrastructure\LoggerFactory. For the logger to work, a dependency must be added to the config/container.php.

Psr\Log\LoggerInterface::class => fn() => new App\Infrastructure\LoggerFactory(),

«Out of the box», logging is only used when catching an error. The HttpSoft\Basis\ErrorHandler\LogErrorListener is responsible for this. Read more about error handling here.