File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ DEBUG=true
33
44BEANS_LOGGING_DISABLE_DEFAULT = false
55BEANS_LOGGING_CONFIG_PATH = " ./configs/logger.yml"
6+ BEANS_LOGGING_DIR = " ./logs"
Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ DEBUG=true
386386
387387BEANS_LOGGING_DISABLE_DEFAULT=false
388388BEANS_LOGGING_CONFIG_PATH="./configs/logger.yml"
389+ BEANS_LOGGING_DIR="./logs"
389390` ` `
390391
391392# # Configuration
Original file line number Diff line number Diff line change @@ -287,6 +287,9 @@ def _check_env(self):
287287 if _is_debug and (self .config .level != "TRACE" ):
288288 self .config .level = "DEBUG"
289289
290+ if "BEANS_LOGGING_DIR" in os .environ :
291+ self .config .file .logs_dir = os .getenv ("BEANS_LOGGING_DIR" )
292+
290293 # if self.config.stream.use_color:
291294 # ## Checking terminal could support xterm colors:
292295 # _TERM = str(os.getenv("TERM")).strip()
@@ -304,6 +307,11 @@ def _check_config(self):
304307 "level_short:<5" , "level.icon:<4"
305308 )
306309
310+ if not os .path .isabs (self .config .file .logs_dir ):
311+ self .config .file .logs_dir = os .path .join (
312+ os .getcwd (), self .config .file .logs_dir
313+ )
314+
307315 if "{app_name}" in self .config .file .log_handlers .log_path :
308316 self .config .file .log_handlers .log_path = (
309317 self .config .file .log_handlers .log_path .format (
You can’t perform that action at this time.
0 commit comments