apertium / apertium-apy

📦 Apertium HTTP Server in Python
https://wiki.apertium.org/wiki/Apertium-apy
GNU General Public License v3.0
32 stars 42 forks source link

apertium-apy doesn't honor -P / --log-path #112

Closed kartikm closed 6 years ago

kartikm commented 6 years ago

New version of apertium-apy (>= 0.11.3) doesn't honor logging -P / --log-path= anymore

Test case:

mkdir /tmp/apy-log /usr/bin/apertium-apy -j1 -m300 --daemon --log-path /tmp/apy-log -p 50000 /usr/share/apertium/modes

This prevents logging for service to files. Only stdout is shown.

kartikm commented 6 years ago

@TinoDidriksen Can you look into this?

TinoDidriksen commented 6 years ago

I don't Python much, and I am not knowledgeable of this codebase. So if it's critical: @sushain97 @unhammer

A quick glance at the code looks correct (https://github.com/apertium/apertium-apy/blob/master/apertium_apy/apy.py#L248).

unhammer commented 6 years ago

Seems like @jonorthwash added the lines: https://github.com/apertium/apertium-apy/commit/cf48209eda132ccdf90db2b7cbf8c8501e6fb670 I've never used --daemon, and still don't see the point, why not just >apy.log 2>apy.err? (Also, why is an option named --daemon doing --redirect-output-to-log-path?)

TinoDidriksen commented 6 years ago

Redirection is not always an option, so passing filenames helps. But I guess this solves the mystery: --log-path is only applicable when --daemon

Edit: Oh, but you have --daemon on and still doesn't work? Hell if I know then.

jonorthwash commented 6 years ago

I have no idea anymore what my thinking was when I added the logic for logging. Please feel free to adjust as makes sense.

kartikm commented 6 years ago

Any updates on this bug?

sushain97 commented 6 years ago

Do we need a v0.11.4 release for this?

kartikm commented 6 years ago

Release with tarball would be nice!

sushain97 commented 6 years ago

Release is out to PyPi. My apologies for the delay.