Skip to content

Commit

Permalink
Fix errorlog file variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nicozanf committed Jul 24, 2024
1 parent c2f98a6 commit 3efb2f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions py4web/utils/logsetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@


def get_log_file(out_banner=True):
log_dir = os.environ.get("PY4WEB_LOGS", None)
if log_dir and os.path.isdir(log_dir):
log_file = os.path.join(log_dir, "server-py4web.log")
log_dir = os.environ.get("PY4WEB_ERRORLOG", None)
if log_dir:
if os.path.isdir(log_dir):
log_file = os.path.join(log_dir, "server-py4web.log")
else:
log_file = log_dir
if out_banner:
print(f"log_file: {log_file}")
return log_file
Expand Down

0 comments on commit 3efb2f8

Please sign in to comment.