You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit abbe6ac
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -39,8 +48,8 @@ A writer is an object that inherits from `Dot\Log\Writer\AbstractWriter`. A writ
39
48
40
49
### Writing to a file (stream)
41
50
42
-
It is possible separate logs into multiple files using writers and filters.
43
-
For example *warnings.log*, *errors.log*, *all_messages.log*.
51
+
It is possible to separate logs into multiple files using writers and filters.
52
+
For example,*warnings.log*, *errors.log*, *all_messages.log*.
44
53
45
54
The following is the simplest example to write all log messages to `/log/dk.log`
46
55
@@ -67,16 +76,16 @@ return [
67
76
* The `FileWriter` key is optional, otherwise the writers array would be enumerative instead of associative.
68
77
* The writer name key is a developer-provided name for that writer, the writer name key is **mandatory**.
69
78
70
-
The writer level key is not affecting the errors that are written, it is a way to organize writers.
79
+
The writer level key is not affecting the errors that are written; it is a way to organize writers.
71
80
72
81
The writer level key is optional.
73
82
74
-
To write into a file the key stream must be present in the writer options array. This is required only if writing into streams/files.
83
+
To write into a file, the key stream must be present in the writer options array. This is required only if writing into streams/files.
75
84
76
85
## Grouping log files by date
77
86
78
87
By default, logs will be written to the same file: `log/dk.log`.
79
-
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option, automatically grouping your logs by day, week, month, year etc.
88
+
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option, automatically grouping your logs by day, week, month, year, etc.
80
89
Examples:
81
90
82
91
*`log/dk-{Y}-{m}-{d}.log` will write every day to a different file (eg: `log/dk-2021-01-01.log`)
@@ -147,7 +156,7 @@ return [
147
156
'importantMessages' => [
148
157
'name' => 'level',
149
158
'options' => [
150
-
// note, the smaller the level, the more important is the message
159
+
// note, the smaller the level, the more important the message
As in the writer configuration, the developer can optionally use keys for associating the filters with a name.
167
176
168
-
IMPORTANT NOTE: the operator for more important messages is <=, this is because the number representation is smaller for a more important message type.
177
+
IMPORTANT NOTE: the operator for more important messages is `<=`, this is because the number representation is smaller for a more important message type.
169
178
170
179
The filter added on the first writer is equal to not setting a filter, but it has been added to illustrate how to explicitly allow all messages.
171
180
@@ -175,14 +184,14 @@ It was added opposite to the others just to demonstrate the other operator is al
175
184
176
185
When using `dot-log`, the logged value is not limited to a string. Arrays can be logged as well.
177
186
178
-
For a better readability, these arrays can be serialized.
187
+
For better readability, these arrays can be serialized.
179
188
180
189
Dot Log provides String formatting and JSON formatting.
181
190
182
-
The formatter accepts following parameters:
191
+
The formatter accepts the following parameters:
183
192
184
-
name - the formatter class (it must implement `Dot\Log\Formatter\FormatterInterface`)
185
-
options - options to pass to the formatter constructor if required
193
+
*`name`: the formatter class (it must implement `Dot\Log\Formatter\FormatterInterface`)
194
+
*`options`: options to pass to the formatter constructor if required
186
195
187
196
The following formats the message as JSON data:
188
197
@@ -243,15 +252,9 @@ Basic usage of the logger is illustrated below.
243
252
The messages are written to see which logs are written and which are not written.
Copy file name to clipboardExpand all lines: docs/book/v3/adding-config-provider.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
* `\Frontend\App\ConfigProvider.php`
6
6
* `\Admin\App\ConfigProvider::class`
7
7
* `\MyProject\ConfigProvider::class` etc.
8
-
* Add the logger configuration in an autoload config file, e.g. you can create `config/autoload/logger.global.php`. Follow the `Configuring the writer(s)` chapter for a simple working example.
8
+
* Add the logger configuration in an autoload config file, e.g., you can create `config/autoload/logger.global.php`. Follow the `Configuring the writer(s)` chapter for a simple working example.
9
9
10
-
> `Dot\Log\ConfigProvider` has an abstract factory `LoggerAbstractServiceFactory::class` which corresponds to the alias, not the class name.
10
+
> `Dot\Log\ConfigProvider` has an abstract factory `LoggerAbstractServiceFactory::class` which corresponds to the alias, not the class name.
11
11
> Instead of requesting `Laminas\Log\Logger::class` from the container, use `dot-log.my_logger` (or just `my_logger` if using laminas-log).
Copy file name to clipboardExpand all lines: docs/book/v3/configuring-writer.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ A writer's responsibility is to record log data to a storage backend. (from lami
8
8
## Writing to a file (stream)
9
9
10
10
You can separate logs into multiple files using writers and filters.
11
-
For example *warnings.log*, *errors.log*, *all_messages.log*.
11
+
For example,*warnings.log*, *errors.log*, *all_messages.log*.
12
12
13
13
The following is the simplest example to write all log messages to `/log/dk.log`:
14
14
@@ -38,11 +38,11 @@ return [
38
38
The `priority` key does not affect the errors that are written.
39
39
It is a way to organize writers, for example:
40
40
41
-
* 1 - FILE
42
-
* 2 - SQL
43
-
* 3 - E-mail
41
+
* 1: FILE
42
+
* 2: SQL
43
+
* 3: E-mail
44
44
45
-
The most important things to write in the file, the sql or e-mail are usually fails because the servers can be external and offline, but the file is on the same server.
45
+
The most important things to write in the file, the SQL or E-mail are usually fails because the servers can be external and offline, but the file is on the same server.
Copy file name to clipboardExpand all lines: docs/book/v3/grouping-log-files-by-date.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
By default, logs will be written to the same file: `log/dk.log`.
4
4
5
-
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option to automatically group your logs by day, week, month, year etc.
5
+
Optionally, you can use date format specifiers wrapped between curly braces in your FileWriter's `stream` option to automatically group your logs by day, week, month, year, etc.
0 commit comments