summaryrefslogtreecommitdiff
path: root/src/conf_mode/syslog.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/syslog.py')
-rwxr-xr-xsrc/conf_mode/syslog.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/conf_mode/syslog.py b/src/conf_mode/syslog.py
index f8f8d9457..e726a5755 100755
--- a/src/conf_mode/syslog.py
+++ b/src/conf_mode/syslog.py
@@ -30,12 +30,15 @@ from vyos import ConfigError
configs = '''
## generated by syslog.py ##
## file based logging
-{% if files['global']['marker'] %}
+{% if files['global']['marker'] -%}
$ModLoad immark
{% if files['global']['marker-interval'] %}
$MarkMessagePeriod {{files['global']['marker-interval']}}
{% endif %}
-{% endif %}
+{% endif -%}
+{% if files['global']['preserver_fqdn'] -%}
+$PreserveFQDN on
+{% endif -%}
{% for file in files %}
$outchannel {{file}},{{files[file]['log-file']}},{{files[file]['max-size']}},{{files[file]['action-on-max-size']}}
{{files[file]['selectors']}} :omfile:${{file}}
@@ -99,11 +102,12 @@ def get_config():
config_data['files'].update(
{
'global' : {
- 'log-file' : '/var/log/messages',
- 'max-size' : 262144,
+ 'log-file' : '/var/log/messages',
+ 'max-size' : 262144,
'action-on-max-size' : '/usr/sbin/logrotate /etc/logrotate.d/vyos-rsyslog',
- 'selectors' : '*.notice;local7.debug',
- 'max-files' : '5'
+ 'selectors' : '*.notice;local7.debug',
+ 'max-files' : '5',
+ 'preserver_fqdn' : False
}
}
)
@@ -118,6 +122,9 @@ def get_config():
config_data['files']['global']['max-size'] = int(c.return_value('global archive size'))* 1024
if c.exists('global archive files'):
config_data['files']['global']['max-files'] = c.return_value('global archive files')
+ if c.exists('global preserve-fqdn'):
+ config_data['files']['global']['preserver_fqdn'] = True
+
###
# set system syslog file
###