Skip to content
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

Merged
merged 10 commits into from Dec 5, 2020
Merged

Change logging documentation #91

merged 10 commits into from Dec 5, 2020

Conversation

devanych
Copy link
Member

@devanych devanych commented Dec 4, 2020

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues yiisoft/log#19

@samdark samdark added the type:docs Documentation label Dec 4, 2020

```
2014-10-04 18:10:15 [::1][][-][trace][yii\base\Module::getModule] Loading module: debug
Timestamp Prifix[Level][Category] Message Context
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Timestamp Prifix[Level][Category] Message Context
Timestamp Prefix[Level][Category] Message Context

Copy link
Member

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.

Comment on lines 120 to 122
* [[\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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [[\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.

```

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
which takes a PHP callable returning a customized message format.
which takes a PHP callable returning a custom formatted message.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `getFormattedMessages` - Gets a list of formatted string log messages.
- `getFormattedMessages` - Get a list of log messages formatted as strings.


- `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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `formatMessages` - Gets formatted all log messages for display as a string.
- `formatMessages` - Get all log messages formatted as a string.

- `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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.

- `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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@devanych devanych requested a review from samdark December 5, 2020 09:40
@samdark samdark merged commit 1e7484b into yiisoft:master Dec 5, 2020
@samdark
Copy link
Member

samdark commented Dec 5, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants