diff --git a/en/00_Getting_Started/03_Environment_Management.md b/en/00_Getting_Started/03_Environment_Management.md index 1173679ed..81e5415ca 100644 --- a/en/00_Getting_Started/03_Environment_Management.md +++ b/en/00_Getting_Started/03_Environment_Management.md @@ -116,7 +116,7 @@ Silverstripe core environment variables are listed here, though you're free to d | `SS_USE_BASIC_AUTH`| Baseline protection for requests handled by Silverstripe. Usually requires additional security measures for comprehensive protection. See [Environment Types](/developer_guides/debugging/environment_types) for caveats.| | `SS_SEND_ALL_EMAILS_TO`| If you define this constant, all emails will be redirected to this address.| | `SS_SEND_ALL_EMAILS_FROM`| If you define this constant, all emails will be sent from this address.| -| `SS_ERROR_LOG` | Relative path to the log file. | +| `SS_ERROR_LOG` | Relative path to the log file (see [Logging and Error Handling](/developer_guides/debugging/error_handling/#logging-to-a-file)). | | `SS_PROTECTED_ASSETS_PATH` | Path to secured assets - defaults to ASSETS_PATH/.protected | | `SS_DATABASE_MEMORY` | Used for SQLite3 DBs | | `SS_TRUSTED_PROXY_IPS` | IP address or CIDR range to trust proxy headers from. If left blank no proxy headers are trusted. Can be set to 'none' (trust none) or '*' (trust all) | diff --git a/en/02_Developer_Guides/07_Debugging/01_Error_Handling.md b/en/02_Developer_Guides/07_Debugging/01_Error_Handling.md index eb511539f..6ee91a094 100644 --- a/en/02_Developer_Guides/07_Debugging/01_Error_Handling.md +++ b/en/02_Developer_Guides/07_Debugging/01_Error_Handling.md @@ -163,12 +163,19 @@ SilverStripe\Core\Injector\Injector: LogFileHandler: class: Monolog\Handler\StreamHandler constructor: - - "../silverstripe.log" + - "/var/www/silverstripe.log" - "info" ``` -The log file will be relative to the main index.php file path (default: inside public/), so "../silverstripe.log" will -create a file in your project root. +[warning] +The log file path must be an absolute file path, as relative paths may behave differently between CLI and HTTP requests. If you want to use a _relative_ path, you can use the `SS_ERROR_LOG` environment variable to declare a file path that is relative to your project root: + +```sh +SS_ERROR_LOG="./silverstripe.log" +``` + +You don't need any of the yaml configuration above if you are using the `SS_ERROR_LOG` environment variable - but you can use a combination of the environment variable and yaml configuration if you want to configure multiple error log files. +[/warning] [notice] You will need to make sure the user running the php process has write access to the log file, wherever you choose to put it. @@ -235,7 +242,7 @@ SilverStripe\Core\Injector\Injector: LogFileHandler: class: Monolog\Handler\StreamHandler constructor: - - "../silverstripe.log" + - "/var/www/silverstripe.log" - "notice" properties: Formatter: '%$Monolog\Formatter\HtmlFormatter'