Skip to content

Commit

Permalink
feat: add layout for logger
Browse files Browse the repository at this point in the history
- %f full path of filename
- %l line number
  • Loading branch information
Chinlinlee committed Apr 1, 2022
1 parent ccac47e commit 65b90db
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions config/log4js.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@
"type": "file",
"filename": "log/burni-info.log",
"maxLogSize": 104857600,
"backups": 3
"backups": 3,
"layout": {
"type": "pattern",
"pattern": "%[[%d] [%p] [file: %f] [line: %l]%] %c - %m"
}
},
"burni-error": {
"type": "file",
"filename": "log/errors.log",
"maxLogSize": 104857600,
"backups": 3
"backups": 3,
"layout": {
"type": "pattern",
"pattern": "%[[%d] [%p] [file: %f] [line: %l]%] %c - %m"
}
},
"burni-warning": {
"type": "file",
"filename": "log/warn.log",
"maxLogSize": 104857600,
"backups": 3
"backups": 3,
"layout": {
"type": "pattern",
"pattern": "%[[%d] [%p] [file: %f] [line: %l]%] %c - %m"
}
},
"errors": {
"type": "logLevelFilter",
Expand All @@ -36,7 +48,11 @@
"appender": "burni-warning"
},
"console": {
"type": "console"
"type": "console",
"layout": {
"type": "pattern",
"pattern": "%[[%d] [%p] [file: %f] [line: %l]%] %c - %m"
}
}
},
"categories": {
Expand All @@ -47,7 +63,8 @@
"errors",
"console"
],
"level": "DEBUG"
"level": "DEBUG",
"enableCallStack": true
}
}
}

0 comments on commit 65b90db

Please sign in to comment.