feat: extended log view and searching by error codes
This commit is contained in:
+13
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user