mirror of
https://github.com/RoboSats/robosats.git
synced 2025-08-01 17:11:44 +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'
|
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.
|
# 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
|
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": {
|
"root": {
|
||||||
"handlers": ["console"],
|
"handlers": ["console"],
|
||||||
"level": "WARNING",
|
"level": config("LOGGER_LEVEL", cast=str, default="WARNING"),
|
||||||
},
|
},
|
||||||
"loggers": {
|
"loggers": {
|
||||||
"api.utils": {
|
"api.utils": {
|
||||||
"handlers": ["console"],
|
"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