Skip to content

Commit 6319c1f

Browse files
log view: fix size and remove parsed line count from footer
1 parent fdd4028 commit 6319c1f

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

app/class/Controlleradmin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function log(): void
112112
'warn' => $_GET['warn'] ?? true,
113113
'error' => $_GET['error'] ?? true,
114114
'info' => $_GET['info'] ?? true,
115-
'limit' => $_GET['limit'] ?? 100,
115+
'limit' => $_GET['limit'] ?? 500,
116116
];
117117

118118
$loglines = file(Model::ERROR_LOG);
@@ -146,7 +146,7 @@ public function log(): void
146146
$this->showtemplate('adminlog', array_merge([
147147
'logs' => array_reverse($logs, true),
148148
'total' => $t,
149-
'filesize' => $stats['size'] / 8,
149+
'filesize' => $stats['size'],
150150
'filelines' => $filelines,
151151
], $filters));
152152
}

app/class/Controllerapipage.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function update(string $page): void
103103

104104
/**
105105
* @throws RuntimeException when saving page fails
106+
*
107+
* @todo This should not throw RuntimeException but manage the exception itself and log friendly error
106108
*/
107109
public function add(string $page): void
108110
{
@@ -119,10 +121,14 @@ public function add(string $page): void
119121
$this->page = $this->pagemanager->newpage(array_merge($this->recievejson(), ['id' => $page]));
120122
$this->page->addauthor($this->user->id());
121123
$this->pagemanager->add($this->page);
124+
$user = $this->user->id();
125+
Logger::info("User '$user' successfully added Page '$page'");
122126
}
123127

124128
/**
125129
* @throws RuntimeException when saving page fails
130+
*
131+
* @todo This should not throw RuntimeException but manage the exception itself and log friendly error
126132
*/
127133
public function put(string $page): void
128134
{

app/class/Controllerpage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ public function log(string $page): void
333333
* Match domain.com/PAGE_ID/add
334334
*
335335
* @throws RuntimeException if page creation failed
336+
*
337+
* @todo This should not throw RuntimeException but manage the exception itself and log friendly error
336338
*/
337339
public function add(string $page): void
338340
{
@@ -360,6 +362,8 @@ public function add(string $page): void
360362
}
361363
$this->page->addauthor($this->user->id());
362364
$this->pagemanager->add($this->page);
365+
$user = $this->user->id();
366+
Logger::info("User '$user' successfully added Page '$page'");
363367
$this->routedirect('pageedit', ['page' => $this->page->id()]);
364368
}
365369

app/view/templates/adminlog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</section>
7777
</main>
7878
<footer>
79-
w_error.log | parsed lines: <?= $total ?> | file lines: <?= $filelines ?> | file size: <?= $this->readablesize($filesize) ?>o
79+
w_error.log | file lines: <?= $filelines ?> | file size: <?= $this->readablesize($filesize) ?>o
8080
</footer>
8181

8282
<?php $this->stop('page') ?>

0 commit comments

Comments
 (0)