Skip to content

Add Support for --logdir and Move Configuration Files to ProgramData for Process Governor #32

Description

@mipsou

Summary

Summary
Add support for a --logdir option in Process Governor to allow users to specify a custom directory for logs. This would improve file organization by separating logs from the executable and configuration files, adhering to best practices for modern application management.

Basic example

A user could specify a custom directory for logs by providing the --logdir argument in the Process Governor command-line:

cmd
Code
"C:\Program Files\ProcessGovernor\Process Governor.exe" --config "C:\ProgramData\ProcessGovernor\config.json" --logdir "C:\ProgramData\ProcessGovernor\logs"
Example Configuration:
A typical setup would include:

Configuration file stored at:
text
Code
C:\ProgramData\ProcessGovernor\config.json
Logs redirected to:
text
Copier le code
C:\ProgramData\ProcessGovernor\logs
Example batch script for automation:

cmd
Code
@echo off
if not exist "C:\ProgramData\ProcessGovernor\logs" mkdir "C:\ProgramData\ProcessGovernor\logs"
"C:\Program Files\ProcessGovernor\Process Governor.exe" --config "C:\ProgramData\ProcessGovernor\config.json" --logdir "C:\ProgramData\ProcessGovernor\logs"
This ensures:

Logs are stored in a dedicated directory.
The configuration is loaded properly.
Folder creation is automated.

Motivation

Why are we doing this?
Currently, logs generated by Process Governor are written in the same directory as the executable. This approach:

Clutters the application directory.
Does not comply with modern conventions where logs should be separated for easier management.
Use cases:
System administrators: Centralize logs in C:\ProgramData for better organization and ease of backup.
Multi-user systems: Ensures logs are stored in a shared, accessible location.
Automation: Makes it easier to automate folder creation and log rotation.
Expected outcome:
Cleaner separation of application files and logs.
Improved portability and maintainability for users.
Align Process Governor with industry-standard application management practices.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P:LowLow priorityenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions