vysheng / tg

telegram-cli
GNU General Public License v2.0
6.48k stars 1.53k forks source link

Log file gets rotated but not reopened? #296

Open Jille opened 10 years ago

Jille commented 10 years ago
jille@azshara:~$ ls -l /var/lib/telegram-cli/*log*
-rw-r----- 1 telegramd telegramd 291 Oct  18 23:52 /var/lib/telegram-cli/telegram-cli.log.1.gz
jille@azshara:~$ sudo ls -l /proc/25258/fd | grep log
l-wx------ 1 telegramd telegramd 64 Oct 18 12:43 1 -> /var/lib/telegram-cli/telegram-cli.log.1 (deleted)
l-wx------ 1 telegramd telegramd 64 Oct 18 12:43 2 -> /var/lib/telegram-cli/telegram-cli.log.1 (deleted)

I'm using /etc/logrotate.d/telegram-cli as installed by the debian package:

/var/lib/telegram-cli/*.log {
        daily
        missingok
        rotate 31
        compress
        notifempty
    nocreate
}

Maybe it does work and it creates the logfile just-in-time, but I doubt there haven't been any logmessages the past 24+ hour.

Jille commented 10 years ago

Great software by the way! I was almost disappointed by the possibilities as I expected to need to do some hacking myself ;)

vysheng commented 10 years ago

what signal does it use to rotate? SIGHUP or SIGUSR1? telegram-cli expects SIGUSR1

Also it doesn't write to log much without verbosity (Probably it wouldn't write anything). To check try to run with many '-v'. (At least '-vvvvvv' to get many log messages).