forked from tari-project/sha-p2pool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add log4rs logger (tari-project#18)
The purpose is to supplement the `log` crate by adding configurability through a [yaml](https://github.com/tari-project/tari-dan/blob/development/config/logs.yml) file. With one central logger, we are able to save data in more granularity, including different output files and not merely runtime logs. Re-uses the `log4rs` implementation in `tari` L1 chain.
- Loading branch information
1 parent
f347fb5
commit 81139b6
Showing
10 changed files
with
106 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
refresh_rate: 30 seconds | ||
appenders: | ||
# An appender named "stdout" that writes to stdout | ||
stdout: | ||
kind: console | ||
encoder: | ||
pattern: "{d(%Y-%m-%dT%H:%M:%S%Z)} {h({l}):5} {t} {m}{n}" | ||
filters: | ||
- kind: threshold | ||
level: info | ||
|
||
# An appender named "p2pool" that writes to a file with a custom pattern encoder | ||
p2pool: | ||
kind: rolling_file | ||
path: "{{log_dir}}/log/p2pool.log" | ||
policy: | ||
kind: compound | ||
trigger: | ||
kind: size | ||
limit: 10mb | ||
roller: | ||
kind: fixed_window | ||
base: 1 | ||
count: 5 | ||
pattern: "{{log_dir}}/log/p2pool.{}.log" | ||
encoder: | ||
pattern: "[{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [Thread:{I}] {l:5} {m}{n}]" | ||
|
||
# Set the default logging level to "warn" and attach the "stdout" appender to the root | ||
root: | ||
level: info | ||
appenders: | ||
- stdout | ||
|
||
loggers: | ||
sharechain: | ||
level: info | ||
appenders: | ||
- p2pool | ||
- stdout | ||
additive: false | ||
p2p: | ||
level: info | ||
appenders: | ||
- p2pool | ||
- stdout | ||
additive: false | ||
server: | ||
level: info | ||
appenders: | ||
- p2pool | ||
- stdout | ||
additive: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters