feat: extended log view and searching by error codes

This commit is contained in:
Björn Fromme
2026-03-20 11:44:55 +01:00
parent 301b14f518
commit 3849ae306c
7 changed files with 176 additions and 14 deletions
+13 -2
View File
@@ -8,6 +8,7 @@ use App\Repository\LogEntryRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LogEntryRepository::class)]
#[ORM\Table(indexes: [new ORM\Index(name: 'IDX_LOG_ENTRY_ERROR_CODE', columns: ['error_code'])])]
class LogEntry
{
#[ORM\Id]
@@ -30,6 +31,9 @@ class LogEntry
#[ORM\Column(type: 'datetime_immutable')]
private \DateTimeImmutable $createdAt;
#[ORM\Column(type: 'string', length: 12, nullable: true)]
private ?string $errorCode = null;
public function __construct(string $channel, string $message)
{
$this->channel = $channel;
@@ -112,9 +116,16 @@ class LogEntry
return $this->getExtra()['request_id'] ?? '-';
}
public function getErrorCode(): string
public function getErrorCode(): ?string
{
return $this->getExtra()['error_code'] ?? '-';
return $this->errorCode;
}
public function setErrorCode(?string $errorCode): self
{
$this->errorCode = $errorCode;
return $this;
}
public function getUri(): string