Skip to content

Commit

Permalink
remove "add_file_and_line" config option
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Mitterhauser committed Mar 21, 2024
1 parent 3ddaf67 commit 72e6bda
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Lib/Log/Engine/GraylogLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class GraylogLog extends BaseLog
'chunk_size' => UdpTransport::CHUNK_SIZE_LAN,
'ssl_options' => null,
'facility' => 'CakePHP',
'add_file_and_line' => true,
'append_backtrace' => false,
'append_session' => false,
'append_post' => false,
Expand Down Expand Up @@ -245,7 +244,6 @@ protected function createMessage($type, $message)
}
$gelfMessage->setAdditional('request_uri', $request->url);
}
$add_file_and_line = $this->_config['add_file_and_line'] === true;
/**
* Append backtrace in case it's not already in the message.
*/
Expand All @@ -255,22 +253,13 @@ protected function createMessage($type, $message)
* Create a debug backtrace.
*/
$trace = null;
if ($add_file_and_line || $append_backtrace) {
if ($append_backtrace) {
$trace = new ClassicBacktrace(
$this->_config['trace_level_offset'],
$this->_config['file_root_dir']
);
}

/**
* In case the log didn't happen in memory (like with reflections), add
* the filename and line to the message.
*/
if ($add_file_and_line && (null !== $trace) && ($trace->lastStep('file') !== null)) {
$gelfMessage->setFile($trace->lastStep('file'));
$gelfMessage->setLine($trace->lastStep('line'));
}

/**
* Append function output to the message.
*/
Expand Down

0 comments on commit 72e6bda

Please sign in to comment.