Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Yeray Santana Hualde
syncEnrollments
Commits
5abb778b
Commit
5abb778b
authored
Jan 23, 2013
by
frankwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added class and function information to log messages based on where the log message was initiated.
parent
23d23dd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
log.php
laravel/log.php
+26
-2
No files found.
laravel/log.php
View file @
5abb778b
...
...
@@ -56,7 +56,31 @@ class Log {
Event
::
fire
(
'laravel.log'
,
array
(
$type
,
$message
));
}
$message
=
static
::
format
(
$type
,
$message
);
$trace
=
debug_backtrace
();
foreach
(
$trace
as
$item
)
{
if
(
$item
[
'class'
]
==
__CLASS__
)
{
continue
;
}
$caller
=
$item
;
break
;
}
$function
=
$caller
[
'function'
];
if
(
isset
(
$caller
[
'class'
]))
{
$class
=
$caller
[
'class'
]
.
'::'
;
}
else
{
$class
=
''
;
}
$message
=
static
::
format
(
$type
,
$class
.
$function
.
' - '
.
$message
);
File
::
append
(
path
(
'storage'
)
.
'logs/'
.
date
(
'Y-m-d'
)
.
'.log'
,
$message
);
}
...
...
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