Skip to content

Instantly share code, notes, and snippets.

@mikeybeck
Last active July 29, 2022 05:55
Show Gist options
  • Select an option

  • Save mikeybeck/784b0628e8819c7b4376a664a76cee45 to your computer and use it in GitHub Desktop.

Select an option

Save mikeybeck/784b0628e8819c7b4376a664a76cee45 to your computer and use it in GitHub Desktop.
Laravel format for LNAV
{
"laravel_log": {
"title": "Laravel log format",
"description": "Log format used by Laravel",
"url": "https://laravel.com/",
"regex": {
"laravel": {
"pattern": "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2})\\] local\\.(?<level>.*?)\\: (\\[(?<supplier>.*)\\] )?(?<body>.*?)\\s?(\\[stacktrace\\](?<stacktrace>(.|\\s)*))?$"
}
},
"value": {
"supplier": { "kind": "string", "identifier": true },
"stacktrace": { "kind": "string", "identifier": false }
},
"level-field": "level",
"level": {
"error": "ERROR",
"warning": "WARNING",
"warning": "ALERT",
"info": "INFO",
"debug": "DEBUG"
},
"body-field": "body",
"sample": [
{ "line" : "[2019-12-26 09:11:07] local.INFO: [supplier] New file detected (checksum: abcdefghijklmnopqrstuvwxyz)" },
{ "line" : "[2019-12-26 09:11:11] local.INFO: [supplier] Start running import (#queue: 123456, checksum: abcdefghijklmnopqrstuvwxyz)" },
{ "line" : "[2019-12-26 09:11:35] local.INFO: [supplier] Get file (main) in 1.219 sec." },
{ "line" : "[2019-12-26 09:12:00] local.DEBUG: [supplier] Import file (main, 53254 lines) in 15.46 sec." },
{ "line" : "[2019-12-26 09:12:01] local.WARNING: [supplier] [collection/getData] 0.7951" },
{ "line" : "[2019-12-26 09:12:05] local.ERROR: [supplier] Import aborted, error in file." },
{ "line" : "[2019-12-26 09:12:05] local.ERROR: Import aborted, error in file." },
{ "line" : "[2019-12-26 09:12:05] local.ERROR: Import aborted, error in file. [stacktrace] #0 trace line 1 #1 trace line 2" },
{ "line" : "[2019-12-26 09:12:05] local.ERROR: Import aborted, error in file.\n[stacktrace] \n#0 trace line 1\n#1 trace line 2" }
]
}
}
@mikeybeck
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment