Skip to content

Commit 23ac5ec

Browse files
#40 - add admin routes for showing and downloading logs; update log creation date
1 parent d50bc9e commit 23ac5ec

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/Controller/Admin/ProcessExecutionCrudController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use CleverAge\UiProcessBundle\Admin\Filter\ProcessExecutionDurationFilter;
1919
use CleverAge\UiProcessBundle\Entity\ProcessExecution;
2020
use CleverAge\UiProcessBundle\Repository\ProcessExecutionRepository;
21+
use EasyCorp\Bundle\EasyAdminBundle\Attribute\AdminRoute;
2122
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
2223
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
2324
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
@@ -108,6 +109,7 @@ public function configureActions(Actions $actions): Actions
108109
);
109110
}
110111

112+
#[AdminRoute('show-logs', 'show-logs')]
111113
public function showLogs(): RedirectResponse
112114
{
113115
/** @var AdminUrlGenerator $adminUrlGenerator */
@@ -132,6 +134,7 @@ public function showLogs(): RedirectResponse
132134
return $this->redirect($url);
133135
}
134136

137+
#[AdminRoute('download-logs', 'download-logs')]
135138
public function downloadLogFile(): Response
136139
{
137140
/** @var ProcessExecution $processExecution */

src/Entity/LogRecord.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(
5858
$this->level = $record->level->value;
5959
$this->message = (string) (new UnicodeString($record->message))->truncate(512);
6060
$this->context = $record->context;
61-
$this->createdAt = \DateTimeImmutable::createFromMutable(new \DateTime());
61+
$this->createdAt = $record->datetime;
6262
}
6363

6464
public function contextIsEmpty(): bool

0 commit comments

Comments
 (0)