Skip to content

Commit

Permalink
Fix logs permission
Browse files Browse the repository at this point in the history
  • Loading branch information
D3vil0p3r committed Nov 11, 2024
1 parent 3518de0 commit c8bf478
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion empire/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,15 @@ def setup_logging(args):

logging_dir = empire_config.yaml["logging"]["directory"]
log_dir = Path(logging_dir)
log_dir.mkdir(parents=True, exist_ok=True)

try:
log_dir.mkdir(parents=True, exist_ok=True)
except PermissionError:
user_home = Path.home()
log_dir = user_home / ".empire" / "client" / "downloads" / "logs"
log.debug(f"Permission denied to create logs in the directory specified in the configuration file. Logs will be stored in {log_dir}")
log_dir.mkdir(parents=True, exist_ok=True)

root_log_file = log_dir / "empire_client.log"

root_logger = logging.getLogger()
Expand Down

0 comments on commit c8bf478

Please sign in to comment.