Difference between revisions of "Simple rsyslog Configuration"

From MythTV Official Wiki
Jump to: navigation, search
(Added EscapeControlCharactersOnReceive info)
m (Why does the rsyslog configuration page reference the syslog-ng configuration page? Now it doesn't.)
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[http://www.rsyslog.com/ rsyslog] is an implementation of [[wikipedia:Syslog|syslog]]. This page provides basic information on configuring rsyslog for use with MythTV, but additional information can be found on the rsyslog [http://www.rsyslog.com/ web site] and [http://wiki.rsyslog.com/ wiki].
+
[http://www.rsyslog.com/ rsyslog] is an implementation of [[wikipedia:Syslog|syslog]]. This page provides basic information on configuring rsyslog for use with MythTV, but additional information can be found on the rsyslog [http://www.rsyslog.com/ web site] and [http://wiki.rsyslog.com/ wiki].  See, also, [[:Category:Syslog Configuration Files]].
  
 
== Simple rsyslog Configuration ==
 
== Simple rsyslog Configuration ==
Line 27: Line 27:
 
  sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythccextractor.log
 
  sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythccextractor.log
 
  sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythavtest.log
 
  sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythavtest.log
 +
 +
In versions 0.26 and above, [[Mythlogserver]] handles all logging requests.
 +
 +
Each log entry would have the program name: <code>mythlogserver</code> before the
 +
name of the program that called for the log.
 +
The MythTVLog template in the following file removes the <code>mythlogserver</code> text.
 +
 +
{{Note box|By default, log entries will have control codes converted to
 +
their octal values (e.g. new-lines will show up as #012.) The conversion
 +
can be prevented by adding ''$EscapeControlCharactersOnReceive off''
 +
to the following file.
 +
This, however, affects ALL syslog logging, not just MythTV.
 +
See warnings [http://www.rsyslog.com/doc/rsconf1_escapecontrolcharactersonreceive.html here].}}
 +
 +
The following is an example of a typical MythTV multi-line message
 +
as it appears in the log file:
 +
 +
<pre>
 +
... CoreContext main.cpp:748 (main) #012===============================================================#012| Attempting to contact the master backend for rescheduling.  |#012| If the master is not running, rescheduling will happen when |#012| the master backend is restarted.                            |#012===============================================================
 +
</pre>
 +
 +
By adding the <code>$EscapeControlCharactersOnReceive off</code> in the file below, the above will
 +
print in its intended format:
 +
 +
<pre>
 +
... CoreContext main.cpp:748 (main)
 +
===============================================================
 +
| Attempting to contact the master backend for rescheduling.  |
 +
| If the master is not running, rescheduling will happen when |
 +
| the master backend is restarted.                            |
 +
===============================================================
 +
</pre>
  
 
{{Script info
 
{{Script info
 
|short=rsyslog configuration for MythTV
 
|short=rsyslog configuration for MythTV
 
|long=Example configuration file for using rsyslog for MythTV application logging.
 
|long=Example configuration file for using rsyslog for MythTV application logging.
 +
|category=Syslog Configuration Files
 +
|name=rsyslog configuration
 +
|S26=yes}}
 +
 +
{{Code box|/etc/rsyslog.d/40-mythtv.conf|
 +
<pre>
 +
# Begin /etc/rsyslog.d/40-mythtv.conf for MythTV Version 0.26 and on.
 +
 +
# Make MythTV logs readable by world
 +
$FileCreateMode 0644
 +
 +
#
 +
# Sample Log Entry: Aug 31 12:08:11 mythosttname mythlogserver: mythbackend[3139]: I HouseKeeping housekeeper.cpp:221 ...
 +
#
 +
 +
# Control-code conversion. The default is on.
 +
$EscapeControlCharactersOnReceive off
 +
 +
# This template drops the mythlogserver: $programname, so messages APPEAR to have the
 +
# traditional programname[<PID>] tag (which is really part of the $msg.)
 +
$template MythTVLog,"%TIMESTAMP% %HOSTNAME% %msg%\n"
 +
 +
# For programs that DON'T use mythlogserver.  This template will create a log file named
 +
# /var/log/[Replaced_with_Name_Of_Myth_Program].log.
 +
$template noLogServerLog,"/var/log/mythtv/%programname%.log"
 +
 +
# By default this results in output that matches the default traditional output. 
 +
# This template could used to modify the output
 +
# $template noLogServerLogFormat,"%TIMESTAMP% %HOSTNAME% %SYSLOGTAG% %msg%\n"
 +
# and by changing the following line to
 +
# if $syslogfacility-text == 'local7' and $programname startswith 'myth' then ?noLogServerLog;noLogServerLogFormat
 +
 +
 +
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythbackend' then /var/log/mythtv/mythbackend.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythfrontend' then /var/log/mythtv/mythfrontend.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythjobqueue' then /var/log/mythtv/mythjobqueue.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythmediaserver' then /var/log/mythtv/mythmediaserver.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythtv-setup' then /var/log/mythtv/mythtv-setup.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythfilldatabase' then /var/log/mythtv/mythfilldatabase.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythcommflag' then /var/log/mythtv/mythcommflag.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythpreviewgen' then /var/log/mythtv/mythpreviewgen.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythtranscode' then /var/log/mythtv/mythtranscode.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythmetadatalookup' then /var/log/mythtv/mythmetadatalookup.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythutil' then /var/log/mythtv/mythutil.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythwelcome' then /var/log/mythtv/mythwelcome.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythshutdown' then /var/log/mythtv/mythshutdown.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythlcdserver' then /var/log/mythtv/mythlcdserver.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythccextractor' then /var/log/mythtv/mythccextractor.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythavtest' then /var/log/mythtv/mythavtest.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $msg startswith ' mythlogserver' then /var/log/mythtv/mythlogserver.log;MythTVLog
 +
& ~
 +
if $syslogfacility-text == 'local7' and $programname startswith 'myth' then ?noLogServerLog
 +
& ~
 +
 +
# Set FileCreateMode back to default. This should be the same value as specified
 +
# in the /etc/rsyslog.conf file.
 +
$FileCreateMode 0640
 +
 +
# End /etc/rsyslog.d/40-mythtv.conf
 +
</pre>
 +
}}
 +
 +
 +
{{Script info
 +
|short=rsyslog configuration for MythTV 0.25
 +
|long=Example configuration file for using rsyslog for MythTV 0.25 application logging.
 
|category=Syslog Configuration Files
 
|category=Syslog Configuration Files
 
|name=rsyslog configuration
 
|name=rsyslog configuration
Line 114: Line 229:
 
}}
 
}}
  
 
 
{{Script info
 
|short=rsyslog configuration for MythTV
 
|long=Example configuration file for using rsyslog for MythTV application logging.
 
|category=Syslog Configuration Files
 
|name=rsyslog configuration
 
|S26=yes}}
 
 
In versions 0.26 and above, <code>mythlogserver</code> handles all logging requests.
 
 
Each log entry would have the program name: <code>mythlogserver</code> before the
 
name of the program that called for the log.
 
The MythTVLog template in the following file removes the <code>mythlogserver</code> text.
 
 
{{Note box|By default, log entries will have control codes converted to
 
their octal values (e.g. new-lines will show up as #012.) The conversion
 
can be prevented by adding ''$EscapeControlCharactersOnReceive off''
 
to the following file.
 
This, however, affects ALL syslog logging, not just MythTV.}}
 
 
The following is an example of a typical MythTV multi-line message
 
as it appears in the log file:
 
 
<pre>
 
... CoreContext main.cpp:748 (main) #012===============================================================#012| Attempting to contact the master backend for rescheduling.  |#012| If the master is not running, rescheduling will happen when |#012| the master backend is restarted.                            |#012===============================================================
 
</pre>
 
 
By adding the <code>$EscapeControlCharactersOnReceive off</code> in the file below, the above will
 
print in its intended format:
 
 
<pre>
 
... CoreContext main.cpp:748 (main)
 
===============================================================
 
| Attempting to contact the master backend for rescheduling.  |
 
| If the master is not running, rescheduling will happen when |
 
| the master backend is restarted.                            |
 
===============================================================
 
</pre>
 
 
{{Code box|/etc/rsyslog.d/40-mythtv.conf|
 
<pre>
 
# Begin /etc/rsyslog.d/40-mythtv.conf for MythTV Version 0.26 and on.
 
 
# Make MythTV logs readable by world
 
$FileCreateMode 0644
 
 
#
 
# Sample Log Entry: Aug 31 12:08:11 mythosttname mythlogserver: mythbackend[3139]: I HouseKeeping housekeeper.cpp:221 ...
 
#
 
 
# Control-code conversion. The default is on.
 
$EscapeControlCharactersOnReceive off
 
 
# This template drops the mythlogserver: $programname, so messages APPEAR to have the
 
# traditional programname[<PID>] tag (which is really part of the $msg.)
 
 
$template MythTVLog,"%TIMESTAMP% %HOSTNAME% %msg%\n"
 
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythbackend' then /var/log/mythtv-syslog/mythbackend.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythfrontend' then /var/log/mythtv-syslog/mythfrontend.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythjobqueue' then /var/log/mythtv-syslog/mythjobqueue.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythmediaserver' then /var/log/mythtv-syslog/mythmediaserver.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythtv-setup' then /var/log/mythtv-syslog/mythtv-setup.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythfilldatabase' then /var/log/mythtv-syslog/mythfilldatabase.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythcommflag' then /var/log/mythtv-syslog/mythcommflag.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythpreviewgen' then /var/log/mythtv-syslog/mythpreviewgen.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythtranscode' then /var/log/mythtv-syslog/mythtranscode.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythmetadatalookup' then /var/log/mythtv-syslog/mythmetadatalookup.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythutil' then /var/log/mythtv-syslog/mythutil.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythwelcome' then /var/log/mythtv-syslog/mythwelcome.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythshutdown' then /var/log/mythtv-syslog/mythshutdown.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythlcdserver' then /var/log/mythtv-syslog/mythlcdserver.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythccextractor' then /var/log/mythtv-syslog/mythccextractor.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythavtest' then /var/log/mythtv-syslog/mythavtest.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' mythlogserver' then /var/log/mythtv-syslog/mythlogserver.log;MythTVLog
 
& ~
 
if $syslogfacility-text == 'local7' and $msg startswith ' myth' then /var/log/mythtv-syslog/undefinedMythTVmsg.log;MythTVLog
 
& ~
 
 
# Set FileCreateMode back to default. This should be the same value as specified
 
# in the /etc/rsyslog.conf file.
 
$FileCreateMode 0640
 
 
# End /etc/rsyslog.d/40-mythtv.conf
 
</pre>
 
}}
 
  
  
 
[[Category:Syslog Configuration Files]]
 
[[Category:Syslog Configuration Files]]

Revision as of 04:38, 18 January 2013

rsyslog is an implementation of syslog. This page provides basic information on configuring rsyslog for use with MythTV, but additional information can be found on the rsyslog web site and wiki. See, also, Category:Syslog Configuration Files.

Simple rsyslog Configuration

This configuration uses a simple approach to logging which separates log lines into different files based on application name. This approach has the benefit that it allows logging to any desired syslog facility and will prevent non-MythTV application logging from getting into MythTV log files (even if another service or application uses the same syslog facility). This configuration assumes that all MythTV applications use syslog logging. This is done by specifying the command-line argument --syslog <facility> to all MythTV applications, for example:

mythbackend --syslog local7

To use the configuration, place the configuration file at /etc/rsyslog.d/40-mythtv.conf, create/update the initial log files with appropriate ownership and permissions, restart rsyslogd, then start MythTV applications with --syslog local7. The commands to create/update the initial log files are given, below, for easier copy/paste (permissions, here, are appropriate for Ubuntu-based systems--change owner and group, as required, for your system):

sudo install -d -m0755 -o syslog -g adm /var/log/mythtv
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythbackend.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythfrontend.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythjobqueue.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythmediaserver.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythtv-setup.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythfilldatabase.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythcommflag.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythpreviewgen.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythtranscode.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythmetadatalookup.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythutil.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythwelcome.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythshutdown.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythmessage.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythlcdserver.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythccextractor.log
sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythavtest.log

In versions 0.26 and above, Mythlogserver handles all logging requests.

Each log entry would have the program name: mythlogserver before the name of the program that called for the log. The MythTVLog template in the following file removes the mythlogserver text.


Important.png Note: By default, log entries will have control codes converted to their octal values (e.g. new-lines will show up as #012.) The conversion can be prevented by adding $EscapeControlCharactersOnReceive off to the following file. This, however, affects ALL syslog logging, not just MythTV. See warnings here.

The following is an example of a typical MythTV multi-line message as it appears in the log file:

... CoreContext main.cpp:748 (main) #012===============================================================#012| Attempting to contact the master backend for rescheduling.  |#012| If the master is not running, rescheduling will happen when |#012| the master backend is restarted.                            |#012===============================================================

By adding the $EscapeControlCharactersOnReceive off in the file below, the above will print in its intended format:

... CoreContext main.cpp:748 (main) 
===============================================================
| Attempting to contact the master backend for rescheduling.  |
| If the master is not running, rescheduling will happen when |
| the master backend is restarted.                            |
===============================================================


Author unknown
Description Example configuration file for using rsyslog for MythTV application logging.
Supports Version26.png 



Script.png /etc/rsyslog.d/40-mythtv.conf

# Begin /etc/rsyslog.d/40-mythtv.conf for MythTV Version 0.26 and on.

# Make MythTV logs readable by world
$FileCreateMode 0644

#
# Sample Log Entry: Aug 31 12:08:11 mythosttname mythlogserver: mythbackend[3139]: I HouseKeeping housekeeper.cpp:221 ...
#

# Control-code conversion. The default is on.
$EscapeControlCharactersOnReceive off

# This template drops the mythlogserver: $programname, so messages APPEAR to have the
# traditional programname[<PID>] tag (which is really part of the $msg.)
$template MythTVLog,"%TIMESTAMP% %HOSTNAME% %msg%\n"

# For programs that DON'T use mythlogserver.  This template will create a log file named 
# /var/log/[Replaced_with_Name_Of_Myth_Program].log.
$template noLogServerLog,"/var/log/mythtv/%programname%.log"

# By default this results in output that matches the default traditional output.  
# This template could used to modify the output 
# $template noLogServerLogFormat,"%TIMESTAMP% %HOSTNAME% %SYSLOGTAG% %msg%\n"
# and by changing the following line to
# if $syslogfacility-text == 'local7' and $programname startswith 'myth' then ?noLogServerLog;noLogServerLogFormat



if $syslogfacility-text == 'local7' and $msg startswith ' mythbackend' then /var/log/mythtv/mythbackend.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythfrontend' then /var/log/mythtv/mythfrontend.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythjobqueue' then /var/log/mythtv/mythjobqueue.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythmediaserver' then /var/log/mythtv/mythmediaserver.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythtv-setup' then /var/log/mythtv/mythtv-setup.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythfilldatabase' then /var/log/mythtv/mythfilldatabase.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythcommflag' then /var/log/mythtv/mythcommflag.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythpreviewgen' then /var/log/mythtv/mythpreviewgen.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythtranscode' then /var/log/mythtv/mythtranscode.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythmetadatalookup' then /var/log/mythtv/mythmetadatalookup.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythutil' then /var/log/mythtv/mythutil.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythwelcome' then /var/log/mythtv/mythwelcome.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythshutdown' then /var/log/mythtv/mythshutdown.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythlcdserver' then /var/log/mythtv/mythlcdserver.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythccextractor' then /var/log/mythtv/mythccextractor.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythavtest' then /var/log/mythtv/mythavtest.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $msg startswith ' mythlogserver' then /var/log/mythtv/mythlogserver.log;MythTVLog
& ~
if $syslogfacility-text == 'local7' and $programname startswith 'myth' then ?noLogServerLog
& ~

# Set FileCreateMode back to default. This should be the same value as specified
# in the /etc/rsyslog.conf file.
$FileCreateMode 0640

# End /etc/rsyslog.d/40-mythtv.conf



Author unknown
Description Example configuration file for using rsyslog for MythTV 0.25 application logging.
Supports Version25.png  



Script.png /etc/rsyslog.d/40-mythtv.conf

# Begin /etc/rsyslog.d/40-mythtv.conf

# While rsyslog should be able to create the required directories and files,
# existing directories and files will not be updated with required ownership
# and permissions. Therefore, to ensure this logging configuration works,
# regardless of existing log files, the required directories and files should
# be updated with appropriate permissions before starting rsyslog. The
# following commands can be used to do this (with permissions, here, given
# for use on Ubuntu-based systems--change owner and group, as required, for
# your system):
#
# sudo install -d -m0755 -o syslog -g adm /var/log/mythtv
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythbackend.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythfrontend.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythjobqueue.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythmediaserver.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythtv-setup.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythfilldatabase.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythcommflag.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythpreviewgen.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythtranscode.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythmetadatalookup.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythutil.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythwelcome.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythshutdown.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythmessage.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythlcdserver.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythccextractor.log
# sudo install -m0644 -o syslog -g adm /dev/null /var/log/mythtv/mythavtest.log

# Make MythTV logs readable by world
$FileCreateMode 0644

# Send all logging from MythTV applications to application-specific log files.
if $programname == 'mythbackend' then /var/log/mythtv/mythbackend.log
& ~
if $programname == 'mythfrontend' then /var/log/mythtv/mythfrontend.log
& ~
if $programname == 'mythjobqueue' then /var/log/mythtv/mythjobqueue.log
& ~
if $programname == 'mythmediaserver' then /var/log/mythtv/mythmediaserver.log
& ~
if $programname == 'mythtv-setup' then /var/log/mythtv/mythtv-setup.log
& ~
if $programname == 'mythfilldatabase' then /var/log/mythtv/mythfilldatabase.log
& ~
if $programname == 'mythcommflag' then /var/log/mythtv/mythcommflag.log
& ~
if $programname == 'mythpreviewgen' then /var/log/mythtv/mythpreviewgen.log
& ~
if $programname == 'mythtranscode' then /var/log/mythtv/mythtranscode.log
& ~
if $programname == 'mythmetadatalookup' then /var/log/mythtv/mythmetadatalookup.log
& ~
if $programname == 'mythutil' then /var/log/mythtv/mythutil.log
& ~
if $programname == 'mythwelcome' then /var/log/mythtv/mythwelcome.log
& ~
if $programname == 'mythshutdown' then /var/log/mythtv/mythshutdown.log
& ~
if $programname == 'mythmessage' then /var/log/mythtv/mythmessage.log
& ~
if $programname == 'mythlcdserver' then /var/log/mythtv/mythlcdserver.log
& ~
if $programname == 'mythccextractor' then /var/log/mythtv/mythccextractor.log
& ~
if $programname == 'mythavtest' then /var/log/mythtv/mythavtest.log
& ~

# Set FileCreateMode back to default.  This should be the same value as specified
# in the /etc/rsyslog.conf file.
$FileCreateMode 0640

# End /etc/rsyslog.d/40-mythtv.conf