2

I am able to view syslog of my lxc container, from outside the container... by;

sudo lxc exec my-abc-container -- /root/tail  /usr/local/var/syslog

or either by tailing it

sudo lxc exec my-abc-container -- /root/tail --follow=name /usr/local/var/syslog

But I have no clue on how to dump this log in a file. Tired of finding similar question but nothing helped.

Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106
Anum Sheraz
  • 2,383
  • 1
  • 29
  • 54

1 Answers1

1

By using file pull

lxc file pull my-abc-container/usr/local/var/syslog ./my-abc-container-syslog

Or by exec

lxc exec my-abc-container -- /bin/sh -c "cat /usr/local/var/syslog" > ./my-abc-container-syslog
Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106