#### Global directives ####

# Sets the directory that rsyslog uses for work files.
$WorkDirectory /var/lib/rsyslog

# Sets default permissions for all log files.
$FileOwner nginx
$FileGroup nginx
$FileCreateMode 0660
$DirCreateMode 0770
$Umask 0007

# Include all config files in /etc/rsyslog.d/.
include(file="/etc/rsyslog.d/*.conf" mode="optional")

#### Modules ####

# Provides --MARK-- message capability.
#module(load="immark")

# Provides support for local system logging (e.g. via logger command).
module(load="imuxsock" SysSock.Name="/tmp/log")

# Nginx
$template rawFormat,"%msg:2:2048%\n"
local0.=notice                  /var/log/access.log;rawFormat
local0.*;local0.!=notice        /var/log/error.log;rawFormat

%REMOTE_SYSLOG%
