genotrance / px

An HTTP proxy server to automatically authenticate through an NTLM proxy
MIT License
955 stars 99 forks source link

Logging Directory <> Working Directory #189

Closed joebosse closed 9 months ago

joebosse commented 1 year ago

I use px-proxy on Linux. Awesome tool by the way ;-). I've installed the python package and configured a systemd service unit with systemctl edit --full --force --user px.service because I want to use it in my user space only. So I generated the config file and configured the service as follows:

[Unit]
Description=Local Proxy

[Service]
WorkingDirectory=/home/user
ExecStart=/usr/local/bin/px --config=/home/user/.config/px.ini

[Install]
WantedBy=default.target

After setting debug to 1 I got an error. The program wanted to log into /usr/local/bin/ where the script file is located. That is not exactly what py --help says. It works only in combination with --uniqlog as expected.

genotrance commented 1 year ago

Need to add a new user configurable cli flag / config file option.

genotrance commented 11 months ago

--log already exists so extending this to support more use cases.

--log=1 = current behavior - log to the script directory - same as --debug --log=2 = log to the working directory --log=3 = log to unique file in working directory - same as --uniqlog --log=4 = log to stdout - same as --verbose

Given --debug, --verbose and --uniqlog are not currently supported by env vars or config file, the above behavior will enable more flexibility. Open to feedback.

genotrance commented 11 months ago

This is fixed in v0.9.0 still in development - see branch.

genotrance commented 9 months ago

v0.9.0 has been released.