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
c0a15ded
Commit
c0a15ded
authored
Jul 02, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added trace level to log message formatting
fixes #4123
parent
0b60e7c6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Dispatcher.php
framework/log/Dispatcher.php
+2
-1
Target.php
framework/log/Target.php
+8
-1
No files found.
framework/CHANGELOG.md
View file @
c0a15ded
...
@@ -62,6 +62,7 @@ Yii Framework 2 Change Log
...
@@ -62,6 +62,7 @@ Yii Framework 2 Change Log
-
Bug #3989: Fixed yii
\l
og
\F
ileTarget::$rotateByCopy to avoid any rename (cebe)
-
Bug #3989: Fixed yii
\l
og
\F
ileTarget::$rotateByCopy to avoid any rename (cebe)
-
Bug #3996: Traversing
`Yii::$app->session`
may cause a PHP error (qiangxue)
-
Bug #3996: Traversing
`Yii::$app->session`
may cause a PHP error (qiangxue)
-
Bug #4020: OCI column detection did not work so gii and other things failed (Sanya1991)
-
Bug #4020: OCI column detection did not work so gii and other things failed (Sanya1991)
-
Bug #4123: Trace level in logger had no effect in Targets, traces where not logged (cebe)
-
Bug #4127:
`CaptchaValidator`
clientside error message wasn't formed properly (samdark)
-
Bug #4127:
`CaptchaValidator`
clientside error message wasn't formed properly (samdark)
-
Bug #4162: Fixed bug where schema name was not used in ’SHOW CREATE TABLE’ query in
`yii\db\mysql\Schema`
(stevekr)
-
Bug #4162: Fixed bug where schema name was not used in ’SHOW CREATE TABLE’ query in
`yii\db\mysql\Schema`
(stevekr)
-
Bug: Fixed inconsistent return of
`\yii\console\Application::runAction()`
(samdark)
-
Bug: Fixed inconsistent return of
`\yii\console\Application::runAction()`
(samdark)
...
...
framework/log/Dispatcher.php
View file @
c0a15ded
...
@@ -9,6 +9,7 @@ namespace yii\log;
...
@@ -9,6 +9,7 @@ namespace yii\log;
use
Yii
;
use
Yii
;
use
yii\base\Component
;
use
yii\base\Component
;
use
yii\base\ErrorHandler
;
/**
/**
* Dispatcher manages a set of [[Target|log targets]].
* Dispatcher manages a set of [[Target|log targets]].
...
@@ -183,7 +184,7 @@ class Dispatcher extends Component
...
@@ -183,7 +184,7 @@ class Dispatcher extends Component
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$target
->
enabled
=
false
;
$target
->
enabled
=
false
;
$targetErrors
[]
=
[
$targetErrors
[]
=
[
'Unable to send log via '
.
get_class
(
$target
)
.
': '
.
$e
->
getMessage
(
),
'Unable to send log via '
.
get_class
(
$target
)
.
': '
.
ErrorHandler
::
convertExceptionToString
(
$e
),
Logger
::
LEVEL_WARNING
,
Logger
::
LEVEL_WARNING
,
__METHOD__
,
__METHOD__
,
microtime
(
true
),
microtime
(
true
),
...
...
framework/log/Target.php
View file @
c0a15ded
...
@@ -235,9 +235,16 @@ abstract class Target extends Component
...
@@ -235,9 +235,16 @@ abstract class Target extends Component
if
(
!
is_string
(
$text
))
{
if
(
!
is_string
(
$text
))
{
$text
=
VarDumper
::
export
(
$text
);
$text
=
VarDumper
::
export
(
$text
);
}
}
$traces
=
[];
if
(
isset
(
$message
[
4
]))
{
foreach
(
$message
[
4
]
as
$trace
)
{
$traces
[]
=
"in
{
$trace
[
'file'
]
}
:
{
$trace
[
'line'
]
}
"
;
}
}
$prefix
=
$this
->
getMessagePrefix
(
$message
);
$prefix
=
$this
->
getMessagePrefix
(
$message
);
return
date
(
'Y-m-d H:i:s'
,
$timestamp
)
.
"
{
$prefix
}
[
$level
][
$category
]
$text
"
;
return
date
(
'Y-m-d H:i:s'
,
$timestamp
)
.
"
{
$prefix
}
[
$level
][
$category
]
$text
"
.
(
empty
(
$traces
)
?
''
:
"
\n
"
.
implode
(
"
\n
"
,
$traces
));
}
}
/**
/**
...
...
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