Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
Last active June 10, 2022 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadLittleMods/084306385e569425a53988934d757612 to your computer and use it in GitHub Desktop.
Save MadLittleMods/084306385e569425a53988934d757612 to your computer and use it in GitHub Desktop.
Extended from https://gist.github.com/benje/e2ab750b0a81d11920d83af637d289f7 for Synapse precise log format
{
"pythonlogger": {
"title": "Python logger format",
"description": "Log format used by python logger class (Synapse precise format)",
"url": "",
"regex": {
"main" : {
"pattern": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3}) - (?<module>\\S+) - (?<lineno>\\w+) - (?<level>\\w+) - (?<request>\\S+) - (?<body>.*)$"
}
},
"timestamp-format": ["%Y-%m-%d %H:%M:%S,%L"],
"level-field": "level",
"level": {
"critical": "CRITICAL",
"error": "ERROR",
"warning": "WARNING",
"info": "INFO",
"debug": "DEBUG"
},
"value": {
"level": { "kind" : "string", "identifier" : true },
"module": { "kind" : "string", "identifier" : true },
"body": { "kind" : "string" }
},
"sample": [
{
"line": "2022-06-10 17:14:58,795 - synapse.rest.media.v1.upload_resource - 104 - INFO - POST-67 - Uploaded content with URI 'mxc://hs1/xyIfNhbvNQvCCDprHxNLLHLd'"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment