Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
6ed8d176
Commit
6ed8d176
authored
Dec 16, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted logging guide, fixed examples for email target
parent
b79f3821
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
logging.md
docs/guide/logging.md
+7
-4
Logger.php
framework/yii/log/Logger.php
+3
-1
MessageInterface.php
framework/yii/mail/MessageInterface.php
+1
-1
No files found.
docs/guide/logging.md
View file @
6ed8d176
...
@@ -51,7 +51,10 @@ You may configure the targets in application configuration, like the following:
...
@@ -51,7 +51,10 @@ You may configure the targets in application configuration, like the following:
'email'
=>
[
'email'
=>
[
'class'
=>
'yii\log\EmailTarget'
,
'class'
=>
'yii\log\EmailTarget'
,
'levels'
=>
[
'error'
,
'warning'
],
'levels'
=>
[
'error'
,
'warning'
],
'emails'
=>
[
'admin@example.com'
],
'message'
=>
[
'to'
=>
[
'admin@example.com'
,
'developer@example.com'
],
'subject'
=>
'New example.com log message'
,
],
],
],
],
],
],
],
...
@@ -59,9 +62,9 @@ You may configure the targets in application configuration, like the following:
...
@@ -59,9 +62,9 @@ You may configure the targets in application configuration, like the following:
]
]
```
```
In the config above we are defining two log targets:
file and email. In both cases we are filtering messages handles by
In the config above we are defining two log targets:
[
[\yii\log\FileTarget|file
]
] and
[
[\yii\log\EmailTarget|email
]
].
these targets by severity. In case of file target we're additionally filter by category.
`yii\*`
means all categories
In both cases we are filtering messages handles by these targets by severity. In case of file target we're
starting with
`yii\`.
additionally filter by category.
`yii\*`
means all categories
starting with
`yii\`.
Each log target can have a name and can be referenced via the [[targets]] property as follows:
Each log target can have a name and can be referenced via the [[targets]] property as follows:
...
...
framework/yii/log/Logger.php
View file @
6ed8d176
...
@@ -43,7 +43,9 @@ use yii\base\InvalidConfigException;
...
@@ -43,7 +43,9 @@ use yii\base\InvalidConfigException;
* 'email' => [
* 'email' => [
* 'class' => 'yii\log\EmailTarget',
* 'class' => 'yii\log\EmailTarget',
* 'levels' => ['error', 'warning'],
* 'levels' => ['error', 'warning'],
* 'emails' => ['admin@example.com'],
* 'message' => [
* 'to' => 'admin@example.com',
* ],
* ],
* ],
* ],
* ],
* ],
* ],
...
...
framework/yii/mail/MessageInterface.php
View file @
6ed8d176
...
@@ -13,7 +13,7 @@ namespace yii\mail;
...
@@ -13,7 +13,7 @@ namespace yii\mail;
* A message represents the settings and content of an email, such as the sender, recipient,
* A message represents the settings and content of an email, such as the sender, recipient,
* subject, body, etc.
* subject, body, etc.
*
*
* Messages are sent by a [[
MailerInterface|
|mailer]], like the following,
* Messages are sent by a [[
\yii\mail\MailerInterface
|mailer]], like the following,
*
*
* ~~~
* ~~~
* Yii::$app->mail->compose()
* Yii::$app->mail->compose()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment