logging icon indicating copy to clipboard operation
logging copied to clipboard

Undefined array key "file"

Open jAKErCZ opened this issue 3 years ago • 1 comments

When trying to log an error to slack, the application will return me.

File: ...\ExceptionStackTraceFormatter.php:27

17:            $context = clone $context;
18:            $attachment = $context->createAttachment();
19:            $attachment->setText(sprintf('*Stack trace* (_%s_)', get_class($exception)));
20:            $attachment->setMarkdown();
21:    
22:            foreach ($exception->getTrace() as $id => $trace) {
23:                $func = $attachment->createField();
24:                $func->setTitle(sprintf(':fireworks: Trace #%s', $id + 1));
25:                $file = $attachment->createField();
26:                $file->setTitle(':open_file_folder: File');
27:                bdump($trace['file']);
28:                $file->setValue('```Function: ' . $trace['function'] . "\nFile: " . $trace['file'] . ':' . $trace['line'] . '```');
29:            }
30:    
31:            return $context;

When listing, it normally returns the file to me.

foreach ($exception->getTrace() as $id => $trace) {
			$func = $attachment->createField();
			$func->setTitle(sprintf(':fireworks: Trace #%s', $id + 1));
			$file = $attachment->createField();
			$file->setTitle(':open_file_folder: File');
            bdump($trace['file']);
			$file->setValue('```Function: ' . $trace['function'] . "\nFile: " . $trace['file'] . ':' . $trace['line'] . '```');
		}

dump

C:\laragon\www\rz-intranet\vendor\nette\utils\src\SmartObject.php'
'C:\laragon\www\rz-intranet\app\CoreModule\Presenters\ProductionPresenter.php

version: contributte/logging v0.6.1 Plug-in support logging for Tracy / Nette Framework

Thx for help

jAKErCZ avatar Sep 23 '21 17:09 jAKErCZ

Can you share your configuration and other stuff? I'm not sure right now.

f3l1x avatar Sep 24 '21 07:09 f3l1x