Closed Vorta closed 7 months ago
I have a similar with Nextclouds JSON log
Message pattern:
^\{"reqId":\"[^\"]*\",\"level\"\:(\d+)\,\"time\"\:\"([^\"]*)\"\,\"remoteAddr\"\:\"[^\"]*\",\"user\":\"[^\"]*\",\"app\":\"([^\"]*)\",\"method\"\:\"[^\"]*\",\"url\"\:\"[^\"]*\",\"message\"\:\"((?:[^"\\]|\\.)*)\",\"userAgent\":\"[^\"]*\",\"version\":\"[^\"]*\"\}$
Message start pattern: ^\{
Time format: HH:mm:ss
Time capture group: 2
Severity capture group: 0
Category capture group (app): 1
Actual message capture group: 3
Sample log:
{"reqId":"y2spiWKKedYotaRJfEKT","level":2,"time":"2019-09-17T17:49:22+02:00","remoteAddr":"127.0.0.1","user":"--","app":"OC\\Log\\Rotate","method":"GET","url":"\/cron.php","message":"Log file \"\/home\/nickv\/Nextcloud\/18\/server\/config\/nickv.nextcloud.log\" was over 52428 bytes, moved to \"\/home\/nickv\/Nextcloud\/18\/server\/config\/nickv.nextcloud.log.1\"","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko\/20100101 Firefox\/69.0","version":"18.0.0.0"}
If I enable it, the warning that no rule matches is gone, but the log is not colored anymore and I actually can't see anything useful from the plugin anymore?
I'm having same troubles with my own logs format...
I don't know if someone get a soluce so I post my conf here.
After all, here a simple line from my log file :
2020-05-31T10:42:58 routing.INFO: Request handled correctly! [] []
I use monolog to generate this kind of log with these options:
$dateFormat = "Y-m-d\TH:i:s";
$output = "%datetime% %channel%.%level_name%: %message% %context% %extra%\n";
$formater = new LineFormatter($output, $dateFormat);
And so, this is my ideolog log format configuration:
Message pattern: ^(.*) (.+?)\.([A-Z]+): (.*)
Message start pattern: ^\d
Time format: yyyy-MM-dd'T'HH:mm:ss
Time capture group: 1
Severity capture group: 3
Category capture group: 2
[x] Apply message pattern to all message lines
Did I misspelled some Regex?
Edit:
I also tried ^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}) (\w).(\w): (.*)
as message pattern, but even after close log file and open it again, it doesn't change.
Fixed in #165. Will be released in the next version. Thanks for your feedback!
I'm trying to add a Symfony Monolog formatter but Ideolog doesn't seem to work.
Version: 192.0.12.0
Message pattern:
^\[(.*)\]\s([\w-\s]+)\.(\w+):\s([^\[\{]+)\s([\[\{].*[\]\}])\s([\[\{].*[\]\}])$
Message start pattern:^\[
Time format:yyyy-MM-dd HH:mm:ss
Time capture group: 1 Severity capture group: 3 Category capture group: 2"Apply message pattern to all message lines" unchecked
Sample log:
Ideolog says: Log format not recognized