Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
9f3ca2e3
Commit
9f3ca2e3
authored
Sep 13, 2018
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2998727
by th_tushar: Remove unnecessary try/catch from logger
parent
e432eea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
core/lib/Drupal/Core/Logger/LoggerChannel.php
core/lib/Drupal/Core/Logger/LoggerChannel.php
+3
-10
No files found.
core/lib/Drupal/Core/Logger/LoggerChannel.php
View file @
9f3ca2e3
...
...
@@ -112,16 +112,9 @@ public function log($level, $message, array $context = []) {
$context
[
'request_uri'
]
=
$request
->
getUri
();
$context
[
'referer'
]
=
$request
->
headers
->
get
(
'Referer'
,
''
);
$context
[
'ip'
]
=
$request
->
getClientIP
();
try
{
if
(
$this
->
currentUser
)
{
$context
[
'uid'
]
=
$this
->
currentUser
->
id
();
}
}
catch
(
\
Exception
$e
)
{
// An exception might be thrown if the database connection is not
// available or due to another unexpected reason. It is more important
// to log the error that we already have so any additional exceptions
// are ignored.
if
(
$this
->
currentUser
)
{
$context
[
'uid'
]
=
$this
->
currentUser
->
id
();
}
}
...
...
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