BitBotFactory / MikaLendingBot

Automated lending on Cryptocurrency exchanges Poloniex and Bitfinex
http://poloniexlendingbot.readthedocs.io/en/latest/index.html
MIT License
1.11k stars 344 forks source link

RE: systemd unit works well but log ging is blob by #639

Open HenrySqwidbern opened 5 years ago

HenrySqwidbern commented 5 years ago

All,

I'm using systemd (ubuntu 16.04 LTS, conda py 2.7.15) to control lendingbot.py as a service, that seems to work dandy, loans get made, things seem stable, but I'm having blobby log output in journalctl. I used the sample unit file snipper over on the readthedocs.io page

========================================================= hank@thesqwid:~$ sudo systemctl status bfx_lendbot.service ● bfx_lendbot.service - BFX_Lendbot Service Loaded: loaded (/etc/systemd/system/bfx_lendbot.service; disabled; vendor preset: enabled) Active: active (running) since Sun 2018-11-25 20:43:16 PST; 1 day 2h ago Main PID: 2392 (python2.7) CGroup: /system.slice/bfx_lendbot.service └─2392 /home/hank/miniconda2/envs/bfx_lendbot/bin/python2.7 -u /home/hank/miniconda2/envs/bfx_lendbot/bin/poloniexlendingbot/lendingbot.py

Nov 26 20:42:02 thesqwid python2.7[2392]: [172B blob data] Nov 26 20:42:32 thesqwid python2.7[2392]: [148B blob data] Nov 26 20:42:58 thesqwid python2.7[2392]: [172B blob data] Nov 26 20:43:28 thesqwid python2.7[2392]: [148B blob data] Nov 26 21:50:16 thesqwid python2.7[2392]: [2.0K blob data] Nov 26 22:04:31 thesqwid python2.7[2392]: [575B blob data] Nov 26 22:04:31 thesqwid python2.7[2392]: [91B blob data] Nov 26 22:05:12 thesqwid python2.7[2392]: [152B blob data] Nov 26 22:05:12 thesqwid python2.7[2392]: [228B blob data] Nov 26 23:15:48 thesqwid python2.7[2392]: [2.0K blob data] hank@thesqwid:~$ =========================================================_

if run manually via console and not via systemd it has sane output. I tried to mod unit file to include '> some_writeable.log' but systemd spazzed out. izit becoz i put unit in "/etc/systemd/..." rather than "/lib/systemd/..."? shouldn't matter. saw the "python -u" for unbuffered output suggested somewhere, no good, same result. should it be put in a script, maybe with conda env trickery? it doesn't seem like that kinda problem at all. it would be nice if it could write pretty log output to journalctl so I can control the bot based on matched strings in that log output. thank you for any suggestions.

Thanks, Hank