mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-29 08:43:21 +00:00
allow logging to file and setting LOGGER_LEVEL
This commit is contained in:
@ -42,6 +42,11 @@ LND_GRPC_HOST='localhost:10009'
|
||||
|
||||
REDIS_URL='redis://localhost:6379/1'
|
||||
|
||||
# If set, log to file specified
|
||||
# LOG_FILE="<path>"
|
||||
# Change logger level (default is "WARNING")
|
||||
# LOGGER_LEVEL="WARNING"
|
||||
|
||||
# List of market price public APIs. If the currency is available in more than 1 API, will use median price.
|
||||
MARKET_PRICE_APIS = https://blockchain.info/ticker, https://api.yadio.io/exrates/BTC, https://bitpay.com/rates/BTC, https://criptoya.com/api/btc
|
||||
|
||||
|
@ -70,12 +70,33 @@ if os.environ.get("LOG_TO_CONSOLE"):
|
||||
},
|
||||
"root": {
|
||||
"handlers": ["console"],
|
||||
"level": "WARNING",
|
||||
"level": config("LOGGER_LEVEL", cast=str, default="WARNING"),
|
||||
},
|
||||
"loggers": {
|
||||
"api.utils": {
|
||||
"handlers": ["console"],
|
||||
"level": "WARNING",
|
||||
"level": config("LOGGER_LEVEL", cast=str, default="WARNING"),
|
||||
},
|
||||
},
|
||||
}
|
||||
elif config("LOG_FILE", False):
|
||||
LOGGING = {
|
||||
"version": 1,
|
||||
"disable_existing_loggers": False,
|
||||
"handlers": {
|
||||
"file": {
|
||||
"class": "logging.FileHandler",
|
||||
"filename": config("LOG_FILE", cast=str),
|
||||
},
|
||||
},
|
||||
"root": {
|
||||
"handlers": ["file"],
|
||||
"level": config("LOGGER_LEVEL", cast=str, default="WARNING"),
|
||||
},
|
||||
"loggers": {
|
||||
"api.utils": {
|
||||
"handlers": ["file"],
|
||||
"level": config("LOGGER_LEVEL", cast=str, default="WARNING"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user