feat: add file logging (#2023)

logs into `lnbits.log` with info loglevel and `debug.log` with DEBUG loglevel
files will be saved into `LNBITS_DATA_DIR`.
retentions is configurable but defaults to `90 days`
* added log rotation aswell

---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡
2023-10-12 11:24:05 +02:00
committed by GitHub
co-authored by Vlad Stan
parent 484e1ae78a
commit 4ec6a055d9
4 changed files with 28 additions and 0 deletions
+3
View File
@@ -296,6 +296,9 @@ class EnvSettings(LNbitsSettings):
lnbits_extensions_path: str = Field(default="lnbits")
super_user: str = Field(default="")
version: str = Field(default="0.0.0")
enable_log_to_file: bool = Field(default=True)
log_rotation: str = Field(default="100 MB")
log_retention: str = Field(default="3 months")
@property
def has_default_extension_path(self) -> bool: