From 543934cedea73381003195e4b29187a93a83bb8a Mon Sep 17 00:00:00 2001 From: Yuri Salimovskiy Date: Fri, 3 Feb 2023 10:58:54 +0200 Subject: [PATCH 1/4] error logging --- docs/installation/best-practices.md | 2 +- docs/toc_sections/_best_practices_toc.yml | 4 ++- docs/troubleshooting/error-logging.md | 33 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 docs/troubleshooting/error-logging.md diff --git a/docs/installation/best-practices.md b/docs/installation/best-practices.md index 8441543fe..6273798a2 100755 --- a/docs/installation/best-practices.md +++ b/docs/installation/best-practices.md @@ -15,7 +15,7 @@ ExpressionEngine's system files and directories are typically safe from direct HTTP access on a properly configured server. -However, for increased security we recommend that the `system` folder either be renamed or moved entirely above the public web root folder (commonly named public_html or referred to as simply "webroot") and that admin.php be renamed as well. This document describes the renaming process. +However, for increased security we recommend that the `system` folder either be renamed or moved entirely above the public web root folder (commonly named `public_html` or referred to as simply "webroot") and that `admin.php` be renamed as well. This document describes the renaming process. ## Renaming the System Directory diff --git a/docs/toc_sections/_best_practices_toc.yml b/docs/toc_sections/_best_practices_toc.yml index 7de9556a1..290f1da07 100644 --- a/docs/toc_sections/_best_practices_toc.yml +++ b/docs/toc_sections/_best_practices_toc.yml @@ -44,4 +44,6 @@ - name: Simple Commerce Module href: troubleshooting/simple-commerce-module.md - name: Error Messages - href: troubleshooting/error-messages.md \ No newline at end of file + href: troubleshooting/error-messages.md + - name: Error Logging + href: troubleshooting/error-logging.md \ No newline at end of file diff --git a/docs/troubleshooting/error-logging.md b/docs/troubleshooting/error-logging.md new file mode 100644 index 000000000..4039a0e5e --- /dev/null +++ b/docs/troubleshooting/error-logging.md @@ -0,0 +1,33 @@ + + +# Error Logging + +[TOC] + +### Error Logging + +There could be situations when there is PHP error that is invisible to the user, but is preventing the code logic to be executed properly. + +To help finding those out, error logging could be enabled in ExpressionEngine. + +To enable error logging, you need to do the following: + +1. Create `logs` folder inside your `system/user` folder and make sure it's writable +2. Open `config.php` file and add following config overrides + - [`log_threshold`](general/system-configuration-overrides.md#log_threshold) (required) + - [`log_date_format`](general/system-configuration-overrides.md#log_date_format) (optional) + +Example: +``` + $config['log_date_format'] = 'Y-m-d H:i:s'; + $config['log_threshold'] = '1'; +``` + +Now, when a code issue is encountered within ExpressionEngine, error or warning message is added to the file for corresponding date inside `system/user/logs` folder. \ No newline at end of file From 9e123d7a4fcf05bf51a6408e6ce950d604a999c1 Mon Sep 17 00:00:00 2001 From: Tom Jaeger Date: Fri, 3 Feb 2023 14:46:43 -0500 Subject: [PATCH 2/4] Update error-logging.md Updating --- docs/troubleshooting/error-logging.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/troubleshooting/error-logging.md b/docs/troubleshooting/error-logging.md index 4039a0e5e..e862d8666 100644 --- a/docs/troubleshooting/error-logging.md +++ b/docs/troubleshooting/error-logging.md @@ -3,7 +3,7 @@ ExpressionEngine User Guide (https://github.com/ExpressionEngine/ExpressionEngine-User-Guide) @link https://expressionengine.com/ - @copyright Copyright (c) 2003-2020, Packet Tide, LLC (https://packettide.com) + @copyright Copyright (c) 2003-2023, Packet Tide, LLC (https://packettide.com) @license https://expressionengine.com/license Licensed under Apache License, Version 2.0 --> @@ -13,9 +13,9 @@ ### Error Logging -There could be situations when there is PHP error that is invisible to the user, but is preventing the code logic to be executed properly. +When debugging is disabled, there can be situations where PHP errors can cause a white screen, or there can be errors that are completley invisable to the user, but result in incorrect execution of a given page. -To help finding those out, error logging could be enabled in ExpressionEngine. +To find these errors, it's recommended to enabled logging in ExpressionEngine. To enable error logging, you need to do the following: @@ -29,5 +29,4 @@ Example: $config['log_date_format'] = 'Y-m-d H:i:s'; $config['log_threshold'] = '1'; ``` - -Now, when a code issue is encountered within ExpressionEngine, error or warning message is added to the file for corresponding date inside `system/user/logs` folder. \ No newline at end of file +After adding the two config file items above, PHP errors, warnings etc. will be added logged to a file with the corresponding date inside `system/user/logs` folder. From 5f92909d99b5b60fd345b1e4cf5c35d9717078c0 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 3 Feb 2023 14:47:29 -0600 Subject: [PATCH 3/4] Update best-practices.md --- docs/installation/best-practices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/best-practices.md b/docs/installation/best-practices.md index 6273798a2..fd67811db 100755 --- a/docs/installation/best-practices.md +++ b/docs/installation/best-practices.md @@ -15,7 +15,7 @@ ExpressionEngine's system files and directories are typically safe from direct HTTP access on a properly configured server. -However, for increased security we recommend that the `system` folder either be renamed or moved entirely above the public web root folder (commonly named `public_html` or referred to as simply "webroot") and that `admin.php` be renamed as well. This document describes the renaming process. +However, for increased security, we recommend that the `system` folder either be renamed or moved entirely above the public web root folder (commonly named `public_html` or referred to as simply "webroot") and that `admin.php` be renamed as well. This document describes the renaming process. ## Renaming the System Directory From 376a8ac89d158c288deb1401e12afcded6aa07d7 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 3 Feb 2023 14:51:46 -0600 Subject: [PATCH 4/4] Update error-logging.md --- docs/troubleshooting/error-logging.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/troubleshooting/error-logging.md b/docs/troubleshooting/error-logging.md index e862d8666..d8da8c806 100644 --- a/docs/troubleshooting/error-logging.md +++ b/docs/troubleshooting/error-logging.md @@ -13,14 +13,14 @@ ### Error Logging -When debugging is disabled, there can be situations where PHP errors can cause a white screen, or there can be errors that are completley invisable to the user, but result in incorrect execution of a given page. +When debugging is disabled, there can be situations where PHP errors can cause a white screen, or there can be errors that are completely invisible to the user but result in incorrect execution of a given page. -To find these errors, it's recommended to enabled logging in ExpressionEngine. +To find these errors, it is recommended to enable logging in ExpressionEngine. To enable error logging, you need to do the following: -1. Create `logs` folder inside your `system/user` folder and make sure it's writable -2. Open `config.php` file and add following config overrides +1. Create a `logs` folder inside your `system/user` folder and make sure it's writable +2. Open the `config.php` file and add the following config overrides: - [`log_threshold`](general/system-configuration-overrides.md#log_threshold) (required) - [`log_date_format`](general/system-configuration-overrides.md#log_date_format) (optional) @@ -29,4 +29,4 @@ Example: $config['log_date_format'] = 'Y-m-d H:i:s'; $config['log_threshold'] = '1'; ``` -After adding the two config file items above, PHP errors, warnings etc. will be added logged to a file with the corresponding date inside `system/user/logs` folder. +After adding the two config file items above, PHP errors, warnings, etc. will be logged to a file with the corresponding date inside the `system/user/logs` folder.