-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patherror-hero-module.local.php
More file actions
115 lines (96 loc) · 3.67 KB
/
error-hero-module.local.php
File metadata and controls
115 lines (96 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
use Pdo\Mysql;
use Laminas\Db\Adapter\AdapterInterface;
use Laminas\Mail\Message;
use Laminas\Mail\Transport\InMemory;
use Laminas\ServiceManager\Factory\InvokableFactory;
$pdoMysqlInitCommandAttr = defined(Mysql::class . '::ATTR_INIT_COMMAND')
? Mysql::ATTR_INIT_COMMAND
: PDO::MYSQL_ATTR_INIT_COMMAND;
return [
'service_manager' => [
'factories' => [
Message::class => InvokableFactory::class,
InMemory::class => InvokableFactory::class,
],
],
'db' => [
'username' => 'root',
'password' => '',
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=errorheromodule;host=127.0.0.1',
'driver_options' => [
$pdoMysqlInitCommandAttr => "SET NAMES 'UTF8'",
],
],
'log' => [
'ErrorHeroModuleLogger' => [
'writers' => [
[
'name' => 'db',
'options' => [
'db' => AdapterInterface::class,
'table' => 'log',
'column' => [
'timestamp' => 'date',
'priority' => 'type',
'message' => 'event',
'extra' => [
'url' => 'url',
'file' => 'file',
'line' => 'line',
'error_type' => 'error_type',
'trace' => 'trace',
'request_data' => 'request_data',
],
],
'formatter' => [
'name' => 'db',
'options' => [
'dateTimeFormat' => 'Y-m-d H:i:s',
],
],
],
],
],
],
],
'error-hero-module' => [
'enable' => true,
'display-settings' => [
// excluded php errors
'exclude-php-errors' => [
\E_USER_DEPRECATED
],
// show or not error
'display_errors' => 0,
// if enable and display_errors = 0, the page will bring layout and view
'template' => [
'layout' => 'layout/layout',
'view' => 'error-hero-module/error-default'
],
// if enable and display_errors = 0, the console will bring message
'console' => [
'message' => 'We have encountered a problem and we can not fulfill your request. An error report has been generated and sent to the support team and someone will attend to this problem urgently. Please try again later. Thank you for your patience.',
],
],
'logging-settings' => [
'same-error-log-time-range' => 86400,
],
'email-notification-settings' => [
// set to true to activate email notification on log error
'enable' => true,
// Laminas\Mail\Message instance registered at service manager
'mail-message' => Message::class,
// Laminas\Mail\Transport\TransportInterface instance registered at service manager
'mail-transport' => InMemory::class,
// email sender
'email-from' => 'Sender Name <sender@host.com>',
// to include or not $_FILES on send mail
'include-files-to-attachments' => true,
'email-to-send' => [
// no email in the list
],
],
],
];