Skip to content

error logging #576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/installation/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion docs/toc_sections/_best_practices_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@
- name: Simple Commerce Module
href: troubleshooting/simple-commerce-module.md
- name: Error Messages
href: troubleshooting/error-messages.md
href: troubleshooting/error-messages.md
- name: Error Logging
href: troubleshooting/error-logging.md
32 changes: 32 additions & 0 deletions docs/troubleshooting/error-logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
This source file is part of the open source project
ExpressionEngine User Guide (https://github.com/ExpressionEngine/ExpressionEngine-User-Guide)

@link https://expressionengine.com/
@copyright Copyright (c) 2003-2023, Packet Tide, LLC (https://packettide.com)
@license https://expressionengine.com/license Licensed under Apache License, Version 2.0
-->

# Error Logging

[TOC]

### 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 completely invisible to the user but result in incorrect execution of a given page.

To find these errors, it is recommended to enable logging in ExpressionEngine.

To enable error logging, you need to do the following:

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)

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 logged to a file with the corresponding date inside the `system/user/logs` folder.