-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
## Adding The Config Provider | ||
# Adding The Config Provider | ||
|
||
* Enter config/config.php | ||
* If there is no entry for the config provider below, add it: | ||
`\Dot\Log\ConfigProvider::class` | ||
* Make sure it is added before with the Application-Specific components, eg.: \Frontend\App\ConfigProvider.php, `\Admin\App\ConfigProvider::class`, `MyProject\ConfigProvider::class` , etc. | ||
* Open the `Dot\Log\ConfigProvider` | ||
* In the dependencies section you will see an absctract factory (LoggerAbstractServiceFactory::class) | ||
* This class responds to "selectors" instead of class names | ||
- Instead of requesting the `Laminas\Log\Logger::class`from the container, dot-log.my_logger should be requested (or just `my_logger` if using laminas-log) | ||
Instead of requesting the `Laminas\Log\Logger::class`from the container, dot-log.my_logger should be requested (or just `my_logger` if using laminas-log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
## Formatting Messages | ||
# Formatting Messages | ||
|
||
When using `dot-log` or `laminas-log`, the logged value is not limited to a string. Arrays can be logged as well. | ||
|
||
For a better readability, these arrays can be serialized. | ||
|
||
Laminas Log provides String formatting, XML, JSON and FirePHP formatting. | ||
|
||
|
||
|
||
The formatter accepts following parameters: | ||
|
||
name - the formatter class (it must implement Laminas\Log\Formatter\FormatterInterface) | ||
options - options to pass to the formatter constructor if required | ||
|
||
|
||
The following formats the message as JSON data: | ||
|
||
'formatter' => [ | ||
'name' => \Laminas\Log\Formatter\Json::class, | ||
], | ||
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
## Grouping log files by date | ||
# Grouping log files by date | ||
|
||
By default, logs will be written to the same file: `log/dk.log`. | ||
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. | ||
Examples: | ||
|
||
* `log/dk-{Y}-{m}-{d}.log` will write every day to a different file (eg: log/dk-2021-01-01.log) | ||
* `log/dk-{Y}-{W}.log` will write every week to a different file (eg: log/dk-2021-10.log) | ||
|
||
The full list of format specifiers is available [here](https://www.php.net/manual/en/datetime.format.php). | ||
The full list of format specifiers is available [here](https://www.php.net/manual/en/datetime.format.php). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters