Configuration
This section will describe how to configure error logging for Pyro.
Error Detail
The debug
option in your config/app.php
configuration file determines how much information about an error is actually displayed to the user. By default, this option is set to respect the value of the APP_DEBUG
environment variable, which is stored in your .env
file.
For local development, you should set the APP_DEBUG
environment variable to true
. In your production environment, this value should always be false
. If the value is set to true
in production, you risk exposing sensitive configuration values to your application's end users.
Log Storage
Out of the box, PyroCMS supports writing log information exactly like Laravel. You can write to single
files, daily
files, the syslog
, and the errorlog
. To configure which storage mechanism Laravel uses, you should modify the log
option in your config/app.php
configuration file. For example, if you wish to use daily log files instead of a single file, you should set the log
value in your app
configuration file to daily
:
'log' => 'daily'
Maximum Daily Log Files
When using the daily
log mode, PyroCMS will only retain five days of log files by default. If you want to adjust the number of retained files, you may add a log_max_files
configuration value to your app
configuration file:
'log_max_files' => 30
Log Severity Levels
When using Monolog, log messages may have different levels of severity. By default, PyroCMS writes all log levels to storage. However, in your production environment, you may wish to configure the minimum severity that should be logged by adding the log_level
option to your app.php
configuration file.
Once this option has been configured, Laravel will log all levels greater than or equal to the specified severity. For example, a default log_level
of error
will log error, critical, alert, and emergency messages:
'log_level' => env('APP_LOG_LEVEL', 'error'),
Monolog recognizes the following severity levels - from least severe to most severe:
-
debug
-
info
-
notice
-
warning
-
error
-
critical
-
alert
-
emergency