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
Change logging documentation #91
Conversation
devanych
commented
Dec 4, 2020
•
edited
edited
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ❌ |
Breaks BC? | ❌ |
Fixed issues | yiisoft/log#19 |
guide/en/runtime/logging.md
Outdated
|
||
``` | ||
2014-10-04 18:10:15 [::1][][-][trace][yii\base\Module::getModule] Loading module: debug | ||
Timestamp Prifix[Level][Category] Message Context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timestamp Prifix[Level][Category] Message Context | |
Timestamp Prefix[Level][Category] Message Context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A real example was handy here. I think it's a good idea to provide it as well.
guide/en/runtime/logging.md
Outdated
* [[\Yiisoft\Log\PsrTarget]]: passes log messages to another PSR-3 compatible logger. | ||
* [[\Yiisoft\Log\StreamTarget]]: writes log messages in specified output stream. | ||
* [[\Yiisoft\Log\Target\Db\DbTarget]]: saves log messages in database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* [[\Yiisoft\Log\PsrTarget]]: passes log messages to another PSR-3 compatible logger. | |
* [[\Yiisoft\Log\StreamTarget]]: writes log messages in specified output stream. | |
* [[\Yiisoft\Log\Target\Db\DbTarget]]: saves log messages in database. | |
* [[\Yiisoft\Log\PsrTarget]]: passes log messages to another PSR-3 compatible logger. | |
* [[\Yiisoft\Log\StreamTarget]]: writes log messages into specified output stream. | |
* [[\Yiisoft\Log\Target\Db\DbTarget]]: saves log messages in database. |
guide/en/runtime/logging.md
Outdated
``` | ||
|
||
By default, log messages will be formatted as follows by the [[\Yiisoft\Log\Target::formatMessage()]]: | ||
You may customize this format by calling [[\Yiisoft\Log\Target::setFormat()|setFormat()]] method, | ||
which takes a PHP callable returning a customized message format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which takes a PHP callable returning a customized message format. | |
which takes a PHP callable returning a custom formatted message. |
guide/en/runtime/logging.md
Outdated
The following protected methods will also be available for child targets: | ||
|
||
- `getMessages` - Gets a list of log messages ([[\Yii\Log\Message]] instances). | ||
- `getFormattedMessages` - Gets a list of formatted string log messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `getFormattedMessages` - Gets a list of formatted string log messages. | |
- `getFormattedMessages` - Get a list of log messages formatted as strings. |
guide/en/runtime/logging.md
Outdated
|
||
- `getMessages` - Gets a list of log messages ([[\Yii\Log\Message]] instances). | ||
- `getFormattedMessages` - Gets a list of formatted string log messages. | ||
- `formatMessages` - Gets formatted all log messages for display as a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `formatMessages` - Gets formatted all log messages for display as a string. | |
- `formatMessages` - Get all log messages formatted as a string. |
guide/en/runtime/logging.md
Outdated
- `getMessages` - Gets a list of log messages ([[\Yii\Log\Message]] instances). | ||
- `getFormattedMessages` - Gets a list of formatted string log messages. | ||
- `formatMessages` - Gets formatted all log messages for display as a string. | ||
- `getCommonContext` - Gets an array with common context data in the `key => value` format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `getCommonContext` - Gets an array with common context data in the `key => value` format. | |
- `getCommonContext` - Get an array with common context data in the `key => value` format. |
guide/en/runtime/logging.md
Outdated
- `formatMessages` - Gets formatted all log messages for display as a string. | ||
- `getCommonContext` - Gets an array with common context data in the `key => value` format. | ||
|
||
For more details, you may refer to any of the log target classes included in the Yii release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more details, you may refer to any of the log target classes included in the Yii release. | |
For more details, you may refer to any of the log target classes included in the package. |
👍 |