Skip to content

Commit ec0ca9d

Browse files
committed
[formats] add laravel_log
1 parent 8087376 commit ec0ca9d

15 files changed

Lines changed: 3390 additions & 423 deletions

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Features:
1717
formats. There is also a `mysql_slow_stats` search table
1818
that captures the various statistics available in a slow
1919
query log message (e.g. `query_time`, `lock_time`, ...).
20+
* Added laravel_log format.
2021
* Annotation handlers can now be lnav scripts if the "handler"
2122
field starts with a pipe (`|`).
2223
* The `<span>` tag in a Markdown now supports

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ set(FORMAT_FILES
199199
formats/java_log.json
200200
formats/journald_json_log.json
201201
formats/katello_log.json
202+
formats/laravel_log.json
202203
formats/lnav_debug_log.json
203204
formats/mysql_error_log.json
204205
formats/mysql_slow_log.json

src/formats/formats.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ FORMAT_FILES = \
2424
$(srcdir)/%reldir%/java_log.json \
2525
$(srcdir)/%reldir%/journald_json_log.json \
2626
$(srcdir)/%reldir%/katello_log.json \
27+
$(srcdir)/%reldir%/laravel_log.json \
2728
$(srcdir)/%reldir%/lnav_debug_log.json \
2829
$(srcdir)/%reldir%/mysql_error_log.json \
2930
$(srcdir)/%reldir%/mysql_gen_log.json \

src/formats/laravel_log.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
3+
"laravel_log": {
4+
"title": "Laravel",
5+
"description": "Laravel log format",
6+
"url": [
7+
"https://laravel.com/docs/12.x/logging"
8+
],
9+
"regex": {
10+
"std": {
11+
"pattern": "^\\[(?<timestamp>[\\d\\-:\\s]+)\\]\\s(?<env>\\w+)\\.(?<level>DEBUG|INFO|NOTICE|WARNING|ERROR|CRITICAL|ALERT|EMERGENCY):\\s(?<body>.*?)(?:\\s(?<context>\\{.*\\}|\\[.*\\])\\s*)?$"
12+
}
13+
},
14+
"value": {
15+
"context": {
16+
"kind": "json"
17+
},
18+
"env": {
19+
"kind": "string",
20+
"identifier": true
21+
},
22+
"level": {
23+
"kind": "string"
24+
},
25+
"timestamp": {
26+
"kind": "string"
27+
}
28+
},
29+
"sample": [
30+
{
31+
"line": "[2025-08-31 06:49:00] local.INFO: User logged in. {\"user_id\": 123}"
32+
},
33+
{
34+
"line": "[2025-08-31 12:34:56] local.ERROR: Something bad happened {\"user_id\":123,\"ip\":\"127.0.0.1\"}"
35+
}
36+
]
37+
}
38+
}

0 commit comments

Comments
 (0)