summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface-definitions/syslog.xml6
-rwxr-xr-xsrc/conf_mode/syslog.py19
2 files changed, 19 insertions, 6 deletions
diff --git a/interface-definitions/syslog.xml b/interface-definitions/syslog.xml
index a1479128c..3c8d2ebe2 100644
--- a/interface-definitions/syslog.xml
+++ b/interface-definitions/syslog.xml
@@ -535,6 +535,12 @@
</leafNode>
</children>
</node>
+ <leafNode name ="preserve-fqdn">
+ <properties>
+ <help>uses FQDN for logging</help>
+ <valueless />
+ </properties>
+ </leafNode>
</children>
</node>
<tagNode name="file">
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
###