g4klx / MMDVMHost

The host program for the MMDVM
GNU General Public License v2.0
378 stars 275 forks source link

Log.cpp - discontinues after 23:59 #329

Open f5vmr opened 7 years ago

f5vmr commented 7 years ago

I am currently monitoring a new repeater, but the log does not create a new occurrence after midnight. So I have to halt the MMDVMHost and restart it to create a new days log as it does not create a new log on its own. I would like to create a continuous log, that I can reset it to zero at midnight using sudo truncate -s 0, using cron, but I am unsure how I could modify the code in order to create the simple log name that I require, bearing in mind the existing IF statement. The existing code could rapidly fill the SD card if not controlled.

My ideal result would be /var/log/mmdvm.log (where it is currently saving courtesy of the .ini). I can then manipulate the result at midnight, saving a copy as necessary before truncating it back to zero.

andershogberg commented 4 years ago

Another option would be to be able to have MMDVMHost use regular syslog. With the possibility of specifying the facility and level in the ini file. With this approach, it's easier to use regular logrotate. Plus it gives the option to more easily send logs off to a syslog server and not risking filling up the SD card.