From 96d7c7c26448934ad8083328fc4cf91321762ab8 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:19:49 +0300 Subject: [PATCH 1/8] Document default log output --- src/cookbook/configuring-webservers/apache.md | 5 ++ .../configuring-webservers/general.md | 21 ++++++++ src/cookbook/configuring-webservers/iis.md | 5 ++ .../configuring-webservers/lighttpd.md | 6 +++ .../configuring-webservers/nginx-unit.md | 6 +++ src/cookbook/configuring-webservers/nginx.md | 6 +++ src/guide/runtime/logging.md | 48 ++++++++++++++++++- 7 files changed, 96 insertions(+), 1 deletion(-) diff --git a/src/cookbook/configuring-webservers/apache.md b/src/cookbook/configuring-webservers/apache.md index 5e82c8d5..5c58a38a 100644 --- a/src/cookbook/configuring-webservers/apache.md +++ b/src/cookbook/configuring-webservers/apache.md @@ -53,3 +53,8 @@ SetEnv APP_ENV dev In the above, note the usage of `SetEnv`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`. + +> [!IMPORTANT] +> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> When Apache uses PHP-FPM, [enable worker output capture](general.md#php-fpm). +> For other PHP setups, configure output capture or [use a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/cookbook/configuring-webservers/general.md b/src/cookbook/configuring-webservers/general.md index 21337bea..d5966704 100644 --- a/src/cookbook/configuring-webservers/general.md +++ b/src/cookbook/configuring-webservers/general.md @@ -7,6 +7,27 @@ Point the document root of your web server to the `app/public` folder. > If you're running your Yii application behind a reverse proxy, you might need to configure > [Trusted proxies and headers](../../guide/security/trusted-request.md). +## Application logs + +The Yii3 application template writes application logs to standard output (`stdout`, or `php://stdout`) by default. +It doesn't create application log files. Standard error (`stderr`) requires explicit log target configuration. +Docker collects container output, but on a server without containers you must configure where that output goes +or [configure a file target](../../guide/runtime/logging.md#logging-to-files). +Web server access and error log settings don't configure Yii's log targets. + +### PHP-FPM + +If your web server uses PHP-FPM, enable worker output capture in the application's PHP-FPM pool configuration: + +```ini +catch_workers_output = yes +``` + +Reload PHP-FPM after changing its configuration. Worker standard output and standard error will go to PHP-FPM's +main error log, whose destination is configured by `error_log` in `php-fpm.conf`. +Without this setting, PHP-FPM redirects both streams to `/dev/null` by default. +See the [PHP-FPM configuration reference](https://www.php.net/manual/en/install.fpm.configuration.php). + ## Specific server configurations - [Nginx](nginx.md) diff --git a/src/cookbook/configuring-webservers/iis.md b/src/cookbook/configuring-webservers/iis.md index 4217dbbc..aac7e7fa 100644 --- a/src/cookbook/configuring-webservers/iis.md +++ b/src/cookbook/configuring-webservers/iis.md @@ -29,3 +29,8 @@ Use the following content: ``` Also, [IIS documentation](https://learn.microsoft.com/en-us/iis/) could be useful to configure PHP on IIS. + +> [!IMPORTANT] +> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> IIS access logs don't replace application logs. Configure output capture for the PHP process or +> [use a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/cookbook/configuring-webservers/lighttpd.md b/src/cookbook/configuring-webservers/lighttpd.md index 551300c6..12520b75 100644 --- a/src/cookbook/configuring-webservers/lighttpd.md +++ b/src/cookbook/configuring-webservers/lighttpd.md @@ -5,3 +5,9 @@ To use [lighttpd](https://www.lighttpd.net/) >= 1.4.24, put `index.php` in the w ``` url.rewrite-if-not-file = ("(.*)" => "/index.php/$0") ``` + +> [!IMPORTANT] +> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> If you use PHP-FPM with lighttpd, [enable worker output capture](general.md#php-fpm). +> Otherwise, configure output capture for the PHP process or +> [use a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/cookbook/configuring-webservers/nginx-unit.md b/src/cookbook/configuring-webservers/nginx-unit.md index 3c736cea..1cf58fc2 100644 --- a/src/cookbook/configuring-webservers/nginx-unit.md +++ b/src/cookbook/configuring-webservers/nginx-unit.md @@ -62,3 +62,9 @@ in the same configuration. Since the Yii3 application template uses environment variables, you can set them in `applications.yii.environment`. In a production environment, remember to set `APP_ENV` to `prod`. + +> [!IMPORTANT] +> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> Docker collects container output. For installations without containers, configure output capture for the +> application process or [use a file target](../../guide/runtime/logging.md#logging-to-files). +> See [application logs](general.md#application-logs) for details. diff --git a/src/cookbook/configuring-webservers/nginx.md b/src/cookbook/configuring-webservers/nginx.md index 52ec9c31..21dac521 100644 --- a/src/cookbook/configuring-webservers/nginx.md +++ b/src/cookbook/configuring-webservers/nginx.md @@ -58,3 +58,9 @@ can detect if a connection is secure. In the above, note the usage of `fastcgi_param APP_ENV`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`. + +> [!IMPORTANT] +> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> The Nginx `access_log` and `error_log` directives above don't capture PHP-FPM worker output. +> [Enable PHP-FPM worker output capture](general.md#php-fpm) or +> [configure a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/guide/runtime/logging.md b/src/guide/runtime/logging.md index c53f76cc..7308d0c3 100644 --- a/src/guide/runtime/logging.md +++ b/src/guide/runtime/logging.md @@ -15,6 +15,21 @@ Using the Yii logging framework involves the following steps: In this section, the focus in on the first two steps. +## Default log destination + +The [application template](https://github.com/yiisoft/app/blob/master/config/common/di/logger.php) +configures `Yiisoft\Log\StreamTarget`, which writes to standard output (`stdout`, or `php://stdout`) by default. +It doesn't create application log files, such as `runtime/logs/app.log`. +Standard error (`stderr`, or `php://stderr`) is also supported, but you must configure it explicitly. + +This works well with Docker, which [collects container output](https://docs.docker.com/engine/logging/). +Use `docker logs ` to read it when the container's logging driver supports that command. + +Without containers, the destination depends on how PHP is started and how its output is captured. +For example, PHP-FPM discards worker output by default unless you enable `catch_workers_output`. +See [web server logging configuration](../../cookbook/configuring-webservers/general.md#application-logs). +To have Yii write application log files directly, configure a [file target](#logging-to-files). + ## Log Messages To record log messages, you need an instance of PSR-3 logger. @@ -130,8 +145,39 @@ learn how to configure and use them. * [[\Yiisoft\Log\Target\File\FileTarget]]: saves log messages in files. * [[\Yiisoft\Log\Target\Syslog\SyslogTarget]]: saves log messages to syslog by calling the PHP function `syslog()`. -In the following, we will describe the features common to all log targets. +### Logging to files + +To write application logs to a file, install the file target package: + +```shell +composer require yiisoft/log-target-file +``` + +In the application template's `config/common/di/logger.php`, replace the `StreamTarget` reference with `FileTarget`: +```php +use Psr\Log\LoggerInterface; +use Yiisoft\Definitions\ReferencesArray; +use Yiisoft\Log\Logger; +use Yiisoft\Log\Target\File\FileTarget; + +return [ + LoggerInterface::class => [ + 'class' => Logger::class, + '__construct()' => [ + 'targets' => ReferencesArray::from([ + FileTarget::class, + ]), + ], + ], +]; +``` + +The package's default configuration writes to `@runtime/logs/app.log` and enables log rotation. +To change the path, set `$params['yiisoft/log-target-file']['fileTarget']['file']` in `config/common/params.php`. +Ensure that the PHP process can write to the log directory, and keep it outside the web server's document root. + +In the following, we will describe the features common to all log targets. ### Message Filtering From 329d34406468f671349feb949d7b0f57dafa0d1a Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:24:17 +0300 Subject: [PATCH 2/8] Disable acronym definition notices --- .vale.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/.vale.ini b/.vale.ini index 2b630a0c..2fa8ef9a 100644 --- a/.vale.ini +++ b/.vale.ini @@ -3,3 +3,4 @@ MinAlertLevel = suggestion [*.md] BasedOnStyles = Microsoft +Microsoft.Acronyms = NO From c46d9fbc65331097e6b84f3b82f0bf6079a77d2e Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:25:13 +0300 Subject: [PATCH 3/8] Disable heading capitalization notices --- .vale.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/.vale.ini b/.vale.ini index 2fa8ef9a..31ef1536 100644 --- a/.vale.ini +++ b/.vale.ini @@ -4,3 +4,4 @@ MinAlertLevel = suggestion [*.md] BasedOnStyles = Microsoft Microsoft.Acronyms = NO +Microsoft.Headings = NO From 0ff6c5448b741f0ba231d007c2a1b6fb45d24828 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:26:13 +0300 Subject: [PATCH 4/8] Disable heading acronym notices --- .vale.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/.vale.ini b/.vale.ini index 31ef1536..a5a1293a 100644 --- a/.vale.ini +++ b/.vale.ini @@ -5,3 +5,4 @@ MinAlertLevel = suggestion BasedOnStyles = Microsoft Microsoft.Acronyms = NO Microsoft.Headings = NO +Microsoft.HeadingAcronyms = NO From a73bfd5eb8d31dca3dcd9efc011999ad04c092bd Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:26:44 +0300 Subject: [PATCH 5/8] Use active voice in logging documentation --- src/cookbook/configuring-webservers/general.md | 4 ++-- src/guide/runtime/logging.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cookbook/configuring-webservers/general.md b/src/cookbook/configuring-webservers/general.md index d5966704..c41f4779 100644 --- a/src/cookbook/configuring-webservers/general.md +++ b/src/cookbook/configuring-webservers/general.md @@ -23,8 +23,8 @@ If your web server uses PHP-FPM, enable worker output capture in the application catch_workers_output = yes ``` -Reload PHP-FPM after changing its configuration. Worker standard output and standard error will go to PHP-FPM's -main error log, whose destination is configured by `error_log` in `php-fpm.conf`. +Reload PHP-FPM after changing its configuration. PHP-FPM sends worker standard output and standard error to its +main error log. The `error_log` directive in `php-fpm.conf` sets the destination. Without this setting, PHP-FPM redirects both streams to `/dev/null` by default. See the [PHP-FPM configuration reference](https://www.php.net/manual/en/install.fpm.configuration.php). diff --git a/src/guide/runtime/logging.md b/src/guide/runtime/logging.md index 7308d0c3..d3bb5bd6 100644 --- a/src/guide/runtime/logging.md +++ b/src/guide/runtime/logging.md @@ -20,12 +20,12 @@ In this section, the focus in on the first two steps. The [application template](https://github.com/yiisoft/app/blob/master/config/common/di/logger.php) configures `Yiisoft\Log\StreamTarget`, which writes to standard output (`stdout`, or `php://stdout`) by default. It doesn't create application log files, such as `runtime/logs/app.log`. -Standard error (`stderr`, or `php://stderr`) is also supported, but you must configure it explicitly. +`StreamTarget` also supports standard error (`stderr`, or `php://stderr`), but you must configure it explicitly. This works well with Docker, which [collects container output](https://docs.docker.com/engine/logging/). Use `docker logs ` to read it when the container's logging driver supports that command. -Without containers, the destination depends on how PHP is started and how its output is captured. +Without containers, the destination depends on how you start PHP and capture its output. For example, PHP-FPM discards worker output by default unless you enable `catch_workers_output`. See [web server logging configuration](../../cookbook/configuring-webservers/general.md#application-logs). To have Yii write application log files directly, configure a [file target](#logging-to-files). From f64b5c82f117828a58ce2530a3286ecb733d152f Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:28:59 +0300 Subject: [PATCH 6/8] Document file target level filtering --- src/guide/runtime/logging.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/guide/runtime/logging.md b/src/guide/runtime/logging.md index d3bb5bd6..bcd36537 100644 --- a/src/guide/runtime/logging.md +++ b/src/guide/runtime/logging.md @@ -177,6 +177,32 @@ The package's default configuration writes to `@runtime/logs/app.log` and enable To change the path, set `$params['yiisoft/log-target-file']['fileTarget']['file']` in `config/common/params.php`. Ensure that the PHP process can write to the log directory, and keep it outside the web server's document root. +The file target package's default configuration also filters out `alert`, `critical`, and `notice` messages. +The template's `StreamTarget` accepts all eight log levels. To keep that behavior, add the following entry to the +array that `config/common/params.php` returns: + +```php +use Psr\Log\LogLevel; + +return [ + // Other application parameters... + 'yiisoft/log-target-file' => [ + 'fileTarget' => [ + 'levels' => [ + LogLevel::EMERGENCY, + LogLevel::ALERT, + LogLevel::CRITICAL, + LogLevel::ERROR, + LogLevel::WARNING, + LogLevel::NOTICE, + LogLevel::INFO, + LogLevel::DEBUG, + ], + ], + ], +]; +``` + In the following, we will describe the features common to all log targets. ### Message Filtering From 43228aacd71609cfb1365f378005f3b448b64a88 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:29:44 +0300 Subject: [PATCH 7/8] Refer to application templates in the plural --- src/cookbook/configuring-webservers/apache.md | 4 ++-- src/cookbook/configuring-webservers/general.md | 4 ++-- src/cookbook/configuring-webservers/iis.md | 2 +- src/cookbook/configuring-webservers/lighttpd.md | 2 +- src/cookbook/configuring-webservers/nginx-unit.md | 4 ++-- src/cookbook/configuring-webservers/nginx.md | 4 ++-- src/guide/runtime/logging.md | 12 +++++++----- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/cookbook/configuring-webservers/apache.md b/src/cookbook/configuring-webservers/apache.md index 5c58a38a..aa5b4407 100644 --- a/src/cookbook/configuring-webservers/apache.md +++ b/src/cookbook/configuring-webservers/apache.md @@ -51,10 +51,10 @@ SetEnv APP_ENV dev # ...other settings... ``` -In the above, note the usage of `SetEnv`. Since the Yii3 application template is using environment variables, this is a possible +In the above, note the usage of `SetEnv`. Since Yii3 application templates use environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`. > [!IMPORTANT] -> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> Yii3 application templates write application logs to `stdout` by default and don't create log files. > When Apache uses PHP-FPM, [enable worker output capture](general.md#php-fpm). > For other PHP setups, configure output capture or [use a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/cookbook/configuring-webservers/general.md b/src/cookbook/configuring-webservers/general.md index c41f4779..17fc88a5 100644 --- a/src/cookbook/configuring-webservers/general.md +++ b/src/cookbook/configuring-webservers/general.md @@ -9,8 +9,8 @@ Point the document root of your web server to the `app/public` folder. ## Application logs -The Yii3 application template writes application logs to standard output (`stdout`, or `php://stdout`) by default. -It doesn't create application log files. Standard error (`stderr`) requires explicit log target configuration. +Yii3 application templates write application logs to standard output (`stdout`, or `php://stdout`) by default. +They don't create application log files. Standard error (`stderr`) requires explicit log target configuration. Docker collects container output, but on a server without containers you must configure where that output goes or [configure a file target](../../guide/runtime/logging.md#logging-to-files). Web server access and error log settings don't configure Yii's log targets. diff --git a/src/cookbook/configuring-webservers/iis.md b/src/cookbook/configuring-webservers/iis.md index aac7e7fa..de4d41f0 100644 --- a/src/cookbook/configuring-webservers/iis.md +++ b/src/cookbook/configuring-webservers/iis.md @@ -31,6 +31,6 @@ Use the following content: Also, [IIS documentation](https://learn.microsoft.com/en-us/iis/) could be useful to configure PHP on IIS. > [!IMPORTANT] -> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> Yii3 application templates write application logs to `stdout` by default and don't create log files. > IIS access logs don't replace application logs. Configure output capture for the PHP process or > [use a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/cookbook/configuring-webservers/lighttpd.md b/src/cookbook/configuring-webservers/lighttpd.md index 12520b75..e4bc54ee 100644 --- a/src/cookbook/configuring-webservers/lighttpd.md +++ b/src/cookbook/configuring-webservers/lighttpd.md @@ -7,7 +7,7 @@ url.rewrite-if-not-file = ("(.*)" => "/index.php/$0") ``` > [!IMPORTANT] -> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> Yii3 application templates write application logs to `stdout` by default and don't create log files. > If you use PHP-FPM with lighttpd, [enable worker output capture](general.md#php-fpm). > Otherwise, configure output capture for the PHP process or > [use a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/cookbook/configuring-webservers/nginx-unit.md b/src/cookbook/configuring-webservers/nginx-unit.md index 1cf58fc2..3442912e 100644 --- a/src/cookbook/configuring-webservers/nginx-unit.md +++ b/src/cookbook/configuring-webservers/nginx-unit.md @@ -60,11 +60,11 @@ Here is a sample configuration. You can also [set up](https://unit.nginx.org/configuration/#php) your PHP environment or supply a custom `php.ini` in the same configuration. -Since the Yii3 application template uses environment variables, you can set them in `applications.yii.environment`. +Since Yii3 application templates use environment variables, you can set them in `applications.yii.environment`. In a production environment, remember to set `APP_ENV` to `prod`. > [!IMPORTANT] -> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> Yii3 application templates write application logs to `stdout` by default and don't create log files. > Docker collects container output. For installations without containers, configure output capture for the > application process or [use a file target](../../guide/runtime/logging.md#logging-to-files). > See [application logs](general.md#application-logs) for details. diff --git a/src/cookbook/configuring-webservers/nginx.md b/src/cookbook/configuring-webservers/nginx.md index 21dac521..581d198d 100644 --- a/src/cookbook/configuring-webservers/nginx.md +++ b/src/cookbook/configuring-webservers/nginx.md @@ -56,11 +56,11 @@ to avoid many unnecessary system `stat()` calls. Also, note that when running an HTTPS server, you need to add `fastcgi_param HTTPS on;` so that Yii can detect if a connection is secure. -In the above, note the usage of `fastcgi_param APP_ENV`. Since the Yii3 application template is using environment variables, +In the above, note the usage of `fastcgi_param APP_ENV`. Since Yii3 application templates use environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`. > [!IMPORTANT] -> The Yii3 application template writes application logs to `stdout` by default and doesn't create log files. +> Yii3 application templates write application logs to `stdout` by default and don't create log files. > The Nginx `access_log` and `error_log` directives above don't capture PHP-FPM worker output. > [Enable PHP-FPM worker output capture](general.md#php-fpm) or > [configure a file target](../../guide/runtime/logging.md#logging-to-files). diff --git a/src/guide/runtime/logging.md b/src/guide/runtime/logging.md index bcd36537..02e2a17d 100644 --- a/src/guide/runtime/logging.md +++ b/src/guide/runtime/logging.md @@ -17,9 +17,11 @@ In this section, the focus in on the first two steps. ## Default log destination -The [application template](https://github.com/yiisoft/app/blob/master/config/common/di/logger.php) -configures `Yiisoft\Log\StreamTarget`, which writes to standard output (`stdout`, or `php://stdout`) by default. -It doesn't create application log files, such as `runtime/logs/app.log`. +Yii3 application templates +([web](https://github.com/yiisoft/app/blob/master/config/common/di/logger.php) and +[API](https://github.com/yiisoft/app-api/blob/master/config/common/di/logger.php)) +configure `Yiisoft\Log\StreamTarget`, which writes to standard output (`stdout`, or `php://stdout`) by default. +They don't create application log files, such as `runtime/logs/app.log`. `StreamTarget` also supports standard error (`stderr`, or `php://stderr`), but you must configure it explicitly. This works well with Docker, which [collects container output](https://docs.docker.com/engine/logging/). @@ -153,7 +155,7 @@ To write application logs to a file, install the file target package: composer require yiisoft/log-target-file ``` -In the application template's `config/common/di/logger.php`, replace the `StreamTarget` reference with `FileTarget`: +In your application's `config/common/di/logger.php`, replace the `StreamTarget` reference with `FileTarget`: ```php use Psr\Log\LoggerInterface; @@ -178,7 +180,7 @@ To change the path, set `$params['yiisoft/log-target-file']['fileTarget']['file' Ensure that the PHP process can write to the log directory, and keep it outside the web server's document root. The file target package's default configuration also filters out `alert`, `critical`, and `notice` messages. -The template's `StreamTarget` accepts all eight log levels. To keep that behavior, add the following entry to the +The templates' `StreamTarget` accepts all eight log levels. To keep that behavior, add the following entry to the array that `config/common/params.php` returns: ```php From 391ced1e0968a62b1b5ceb500131b87c1e29b055 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 15 Oct 2026 12:31:34 +0300 Subject: [PATCH 8/8] Deduplicate web server logging guidance --- src/cookbook/configuring-webservers/apache.md | 5 +---- src/cookbook/configuring-webservers/iis.md | 5 +---- src/cookbook/configuring-webservers/lighttpd.md | 6 +----- src/cookbook/configuring-webservers/nginx-unit.md | 6 +----- src/cookbook/configuring-webservers/nginx.md | 7 ++----- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/cookbook/configuring-webservers/apache.md b/src/cookbook/configuring-webservers/apache.md index aa5b4407..af5a1405 100644 --- a/src/cookbook/configuring-webservers/apache.md +++ b/src/cookbook/configuring-webservers/apache.md @@ -54,7 +54,4 @@ SetEnv APP_ENV dev In the above, note the usage of `SetEnv`. Since Yii3 application templates use environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`. -> [!IMPORTANT] -> Yii3 application templates write application logs to `stdout` by default and don't create log files. -> When Apache uses PHP-FPM, [enable worker output capture](general.md#php-fpm). -> For other PHP setups, configure output capture or [use a file target](../../guide/runtime/logging.md#logging-to-files). +See [application logs](general.md#application-logs) for logging configuration. diff --git a/src/cookbook/configuring-webservers/iis.md b/src/cookbook/configuring-webservers/iis.md index de4d41f0..6cb5625a 100644 --- a/src/cookbook/configuring-webservers/iis.md +++ b/src/cookbook/configuring-webservers/iis.md @@ -30,7 +30,4 @@ Use the following content: Also, [IIS documentation](https://learn.microsoft.com/en-us/iis/) could be useful to configure PHP on IIS. -> [!IMPORTANT] -> Yii3 application templates write application logs to `stdout` by default and don't create log files. -> IIS access logs don't replace application logs. Configure output capture for the PHP process or -> [use a file target](../../guide/runtime/logging.md#logging-to-files). +See [application logs](general.md#application-logs) for logging configuration. diff --git a/src/cookbook/configuring-webservers/lighttpd.md b/src/cookbook/configuring-webservers/lighttpd.md index e4bc54ee..f5549624 100644 --- a/src/cookbook/configuring-webservers/lighttpd.md +++ b/src/cookbook/configuring-webservers/lighttpd.md @@ -6,8 +6,4 @@ To use [lighttpd](https://www.lighttpd.net/) >= 1.4.24, put `index.php` in the w url.rewrite-if-not-file = ("(.*)" => "/index.php/$0") ``` -> [!IMPORTANT] -> Yii3 application templates write application logs to `stdout` by default and don't create log files. -> If you use PHP-FPM with lighttpd, [enable worker output capture](general.md#php-fpm). -> Otherwise, configure output capture for the PHP process or -> [use a file target](../../guide/runtime/logging.md#logging-to-files). +See [application logs](general.md#application-logs) for logging configuration. diff --git a/src/cookbook/configuring-webservers/nginx-unit.md b/src/cookbook/configuring-webservers/nginx-unit.md index 3442912e..04ca5c27 100644 --- a/src/cookbook/configuring-webservers/nginx-unit.md +++ b/src/cookbook/configuring-webservers/nginx-unit.md @@ -63,8 +63,4 @@ in the same configuration. Since Yii3 application templates use environment variables, you can set them in `applications.yii.environment`. In a production environment, remember to set `APP_ENV` to `prod`. -> [!IMPORTANT] -> Yii3 application templates write application logs to `stdout` by default and don't create log files. -> Docker collects container output. For installations without containers, configure output capture for the -> application process or [use a file target](../../guide/runtime/logging.md#logging-to-files). -> See [application logs](general.md#application-logs) for details. +See [application logs](general.md#application-logs) for logging configuration. diff --git a/src/cookbook/configuring-webservers/nginx.md b/src/cookbook/configuring-webservers/nginx.md index 581d198d..3ca26cb4 100644 --- a/src/cookbook/configuring-webservers/nginx.md +++ b/src/cookbook/configuring-webservers/nginx.md @@ -59,8 +59,5 @@ can detect if a connection is secure. In the above, note the usage of `fastcgi_param APP_ENV`. Since Yii3 application templates use environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`. -> [!IMPORTANT] -> Yii3 application templates write application logs to `stdout` by default and don't create log files. -> The Nginx `access_log` and `error_log` directives above don't capture PHP-FPM worker output. -> [Enable PHP-FPM worker output capture](general.md#php-fpm) or -> [configure a file target](../../guide/runtime/logging.md#logging-to-files). +The Nginx `access_log` and `error_log` directives above don't capture PHP-FPM worker output. +See [application logs](general.md#application-logs) for logging configuration.