vysheng / tg

telegram-cli
GNU General Public License v2.0
6.45k stars 1.52k forks source link

Log to file option (L switch) is not working #563

Open SyRenity opened 9 years ago

SyRenity commented 9 years ago

The L switch doesn't seem to create a log file on disk, e.g. setting it to: -L /var/log/telebot.log does nothing, even when launching with root permissions.

Any idea how to enable the disk log files?

vysheng commented 9 years ago

try to add -d option

vysheng commented 9 years ago

it's used for daemon mode, so I am afraid that input may break in that case

SyRenity commented 9 years ago

I don't use manual input (only LUA scripting) so it's fine.

Tried setting -d, still didn't work. Using latest 1.3.1

vysheng commented 9 years ago

bin/telegram-cli -vvvv -L tmp -d works for me. Do you have permissions to write to log file? Note, that if you are running under root, telegram-cli will try to setuid to telegramd user. To prevent add -U root option

SyRenity commented 9 years ago

Thanks, this sorted it out.

I do get the following error logged now:

[warn] Epoll ADD(1) on fd 0 failed. Old events were 0; read change was 1 (add); write change was 0 (none): Operation not permitted

Any idea what it means?

vysheng commented 9 years ago

it's some error inside libevent. In most cases it isn't something bad

SyRenity commented 9 years ago

One more question about this - what are the differences between regular and daemon modes, other then lack of console?

SyRenity commented 9 years ago

@vysheng Also, is there a way to create a PID file (for monitoring by an external watchdog)?