Skip to content

Commit a540631

Browse files
authored
Merge pull request #576 from ExpressionEngine/feature/7.x/error-logging
error logging
2 parents 24783e4 + 376a8ac commit a540631

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

docs/installation/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
ExpressionEngine's system files and directories are typically safe from direct HTTP access on a properly configured server.
1717

18-
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.
18+
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.
1919

2020
## Renaming the System Directory
2121

docs/toc_sections/_best_practices_toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@
4444
- name: Simple Commerce Module
4545
href: troubleshooting/simple-commerce-module.md
4646
- name: Error Messages
47-
href: troubleshooting/error-messages.md
47+
href: troubleshooting/error-messages.md
48+
- name: Error Logging
49+
href: troubleshooting/error-logging.md
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
This source file is part of the open source project
3+
ExpressionEngine User Guide (https://github.com/ExpressionEngine/ExpressionEngine-User-Guide)
4+
5+
@link https://expressionengine.com/
6+
@copyright Copyright (c) 2003-2023, Packet Tide, LLC (https://packettide.com)
7+
@license https://expressionengine.com/license Licensed under Apache License, Version 2.0
8+
-->
9+
10+
# Error Logging
11+
12+
[TOC]
13+
14+
### Error Logging
15+
16+
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.
17+
18+
To find these errors, it is recommended to enable logging in ExpressionEngine.
19+
20+
To enable error logging, you need to do the following:
21+
22+
1. Create a `logs` folder inside your `system/user` folder and make sure it's writable
23+
2. Open the `config.php` file and add the following config overrides:
24+
- [`log_threshold`](general/system-configuration-overrides.md#log_threshold) (required)
25+
- [`log_date_format`](general/system-configuration-overrides.md#log_date_format) (optional)
26+
27+
Example:
28+
```
29+
$config['log_date_format'] = 'Y-m-d H:i:s';
30+
$config['log_threshold'] = '1';
31+
```
32+
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.

0 commit comments

Comments
 (0)