Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
Last active Jun 10, 2022
Embed
What would you like to do?
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