Skip to content

Syslog-ng stops logging on console after system time is changed #2836

@varunpandeyengg

Description

@varunpandeyengg

syslog-ng

Version of syslog-ng

syslog-ng 3.8.1
Installer-Version: 3.8.1
Revision: 3.8.1
Module-Directory: /usr/lib/syslog-ng/3.8
Module-Path: /usr/lib/syslog-ng/3.8
Available-Modules: syslogformat,afuser,basicfuncs,csvparser,cef,confgen,afsql,affile,afsocket,date,sdjournal,dbparser,pseudofile,json-plugin,afprog,disk-buffer,system-source,linux-kmsg-format,cryptofuncs,kvformat
Enable-Debug: off
Enable-GProf: off
Enable-Memtrace: off
Enable-IPv6: on
Enable-Spoof-Source: on
Enable-TCP-Wrapper: on
Enable-Linux-Caps: off

Platform

Debian Stretch

Steps to reproduce

After changing the system time to an older timestamp, I am observing syslog-ng 3.8.1 on debian stretch stops forwarding logs to console. Here are the steps:

  1. Change the clock:
root:~# hwclock --show
2012-12-15 17:04:18.343204+0000
root:~# date
Sat Dec 15 17:05:49 UTC 2012
  1. Generate Log and verify journals:
root:~# journalctl -b | grep dummy
Dec 15 17:03:29 OS process[712]: dummy msg

Configuration

@version: 3.8
@include "scl.conf"

# Syslog-ng configuration file, compatible with default Debian syslogd
# installation.

template Format {template("$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC.$MSEC $HOST $PROGRAM[$LEVEL]:  $MSG\n");};

# First, set some global options.
options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
          owner("root"); group("adm"); perm(0640); dir_perm(0755) ; stats_freq(0);
          bad_hostname("^gconfd$"); file-template(Format);
};

########################
# Sources
########################
# This is the default behavior of sysklogd package
# Logs may come from unix stream, but not from another machine.
#
source s_src {
       system();
       internal();
};

# If you wish to get logs from remote machine you should uncomment
# this and comment the above source line.
#
#source s_net { tcp(ip(127.0.0.1) port(1000)); };

########################
# Destinations
########################
# First some standard logfile
#
destination d_syslog { file("/var/log/syslog"); };
destination d_messages { file("/var/log/messages"); };

# The root's console.
#
destination d_console { usertty("root"); };

# Virtual console.
#
destination d_console_all { file(`tty10`); };

########################
# Filters
########################
# Here's come the filter options. With this rules, we can set which
# message go where.

filter f_dbg { level(debug); };
filter f_info { level(info); };
filter f_notice { level(notice); };
filter f_warn { level(warn); };
filter f_err { level(err); };
filter f_crit { level(crit .. emerg); };

filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
filter f_error { level(err .. emerg) ; };
filter f_messages { level(info,notice,warn) and
                    not facility(auth,authpriv,cron,daemon,mail,news); };

filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
filter f_cron { facility(cron) and not filter(f_debug); };
filter f_daemon { facility(daemon) and not filter(f_debug); };
filter f_kern { facility(kern) and not filter(f_debug); };
filter f_lpr { facility(lpr) and not filter(f_debug); };
filter f_local { facility(local0, local1, local3, local4, local5,
                        local6, local7) and not filter(f_debug); };
filter f_mail { facility(mail) and not filter(f_debug); };
filter f_news { facility(news) and not filter(f_debug); };
filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
filter f_user { facility(user) and not filter(f_debug); };
filter f_uucp { facility(uucp) and not filter(f_debug); };

filter f_cnews { level(notice, err, crit) and facility(news); };
filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };

filter f_ppp { facility(local2) and not filter(f_debug); };
filter f_console { level(warn .. emerg); };

########################
# Log paths
########################
log { source(s_src); filter(f_auth); destination(d_syslog); };
log { source(s_src); filter(f_cron); destination(d_syslog); };
log { source(s_src); filter(f_daemon); destination(d_syslog); };
log { source(s_src); filter(f_kern); destination(d_messages); };
log { source(s_src); filter(f_syslog3); destination(d_syslog); };

log { source(s_src); filter(f_debug); destination(d_syslog); };
log { source(s_src); filter(f_error); destination(d_syslog); };
log { source(s_src); filter(f_messages); destination(d_messages); };

log { source(s_src); filter(f_console); destination(d_console_all); };
log { source(s_src); filter(f_crit); destination(d_console); };

log {
  source(s_src);
  filter {('${LEVEL_NUM}' <= '5' and '${FACILITY_NUM}' == '160') or ('${LEVEL_NUM}' == '7' and '${FACILITY_NUM}' == '160')};
  destination {file('/dev/console'  perm(0644)  flags(syslog-protocol)  frac-digits(6)  persist-name(dest_label_console_1) );};
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions