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
34c7a81a
Commit
34c7a81a
authored
Jun 26, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4067 from yiisoft/better-log-target-failures
Fixes #3101: Improved handling of log target failures
parents
8eb53f04
38c056c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Dispatcher.php
framework/log/Dispatcher.php
+17
-1
No files found.
framework/CHANGELOG.md
View file @
34c7a81a
...
...
@@ -74,6 +74,7 @@ Yii Framework 2 Change Log
-
Enh #2942: Added truncate and truncateWord methods (Alex-Code, samdark)
-
Enh #3008: Added
`Html::errorSummary()`
(qiangxue)
-
Enh #3088: The debug and gii modules will manage their own URL rules now (hiltonjanfield, qiangxue)
-
Enh #3101: Improved handling of log target failures. It will now skip target and log reason instead of going into infinite cycle (samdark)
-
Enh #3103: debugger panel is now not displayed when printing a page (githubjeka)
-
Enh #3108: Added
`yii\debug\Module::enableDebugLogs`
to disable logging debug logs by default (qiangxue)
-
Enh #3132:
`yii\rbac\PhpManager`
now supports more compact data file format (qiangxue)
...
...
framework/log/Dispatcher.php
View file @
34c7a81a
...
...
@@ -175,10 +175,26 @@ class Dispatcher extends Component
*/
public
function
dispatch
(
$messages
,
$final
)
{
$targetErrors
=
[];
foreach
(
$this
->
targets
as
$target
)
{
if
(
$target
->
enabled
)
{
$target
->
collect
(
$messages
,
$final
);
try
{
$target
->
collect
(
$messages
,
$final
);
}
catch
(
\Exception
$e
)
{
$target
->
enabled
=
false
;
$targetErrors
[]
=
[
'Unable to send log via '
.
get_class
(
$target
)
.
': '
.
$e
->
getMessage
(),
Logger
::
LEVEL_WARNING
,
__METHOD__
,
microtime
(
true
),
[],
];
}
}
}
if
(
!
empty
(
$targetErrors
))
{
$this
->
dispatch
(
$targetErrors
,
true
);
}
}
}
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