[mythtv-users] logfile selection

Bill Meek keemllib at gmail.com
Sat Mar 30 18:25:17 UTC 2019


On 3/30/19 1:00 PM, Stephen Worthington wrote:
> On Sat, 30 Mar 2019 12:44:38 -0400, you wrote:
> 
>> I get a lot of log files I don't need. I really only want the
>> mythbackendlog and sometimes the mythfilldatabase. I definitely don't
>> want the many mythpreviewgen files and generally not the mythcommflag or
>> the mythmetadatalookup files.
>>
>> How do I specify exactly which log files I want it to generate.
> 
> It is generally better to keep all the log files, as that means you
> have them when something goes wrong and can then use them to diagnose
> the problem.  Normally, the log files will be handled via syslog
> (rsyslogd) and will be rotated automatically (using logrotate), so
> they will not grow too big or too many.  If your log files are not
> handled that way, then I would suggest setting them up so that they
> are.  The settings for controlling rsyslogd are normally in
> /etc/rsyslog.d and for logrotate are in /etc/logrotate.d.  Adjust them
> as required to control what is logged to what files, and how those log
> files are rotated.
> 
> If you want to disable log output, then run each myth<xxx> command
> with its "--help" option to find its command line logging options,
> then find where it is run from and adjust the command line settings to
> change the log output.
> 
> What distro are you using?

Also note that commands like mythpreviewgen, run by the backend, inherit the
backend's logging choices.

The comment in the initial paragraph could suggest that the --logpath switch
is in play.

If that's the case, a cron.hourly script containing lines like:

   find /var/log/mythtv -type f -mmin  +15 -name "mythpreviewgen.2*.log" -delete

clears preview files > 15 minutes old (choose times/cron.xxx to your liking.)

Personally, I pipe the output of a find to a local script that archives the
detailed logs into a myth<xxx>.log file and let logrotate manage them as
Stephen suggests.

-- 
Bill


More information about the mythtv-users mailing list