forked from jtclark/monolog-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
33 lines (25 loc) · 825 Bytes
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
use Jtclark\MonologViewer;
date_default_timezone_set('UTC');
require(__DIR__ . '/vendor/autoload.php');
$viewer = new MonologViewer([
'user' => 'user',
'pass' => 'abc123',
'path' => __DIR__ . '/sample.log',
//'template' => 'log.twig'
]);
$viewer->authenticate();
$viewer->render(
isset($_GET['lines']) ? $_GET['lines'] : 100,
isset($_GET['filter']) ? $_GET['filter'] : null,
isset($_GET['sc']) ? $_GET['sc'] : null,
isset($_GET['q']) ? $_GET['q'] : null
);
// render last 100 log entries
//$viewer->render(100);
// render last 100 error log entries
//$viewer->render(100, 'error');
// render last 100 log entries with support code 763b463
//$viewer->render(100, null, '763b463');
// render last 100 log entries with search keyword POST
//$viewer->render(100, null, null, 'POST');