Skip to content

Commit

Permalink
[show]: If rotated syslog.1 file exists, concatenate output of syslog…
Browse files Browse the repository at this point in the history
….1 and syslog (sonic-net#159)
  • Loading branch information
jleveque authored Dec 5, 2017
1 parent f57427e commit 835825d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,10 @@ def logging(process, lines, follow):
if follow:
run_command("sudo tail -f /var/log/syslog")
else:
command = "sudo cat /var/log/syslog"
if os.path.isfile("/var/log/syslog.1"):
command = "sudo cat /var/log/syslog.1 /var/log/syslog"
else:
command = "sudo cat /var/log/syslog"

if process is not None:
command += " | grep '{}'".format(process)
Expand Down

0 comments on commit 835825d

Please sign in to comment.