Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check syslog for ubuntu docker

I installed tutum/ubuntu in local vm's docker.

When I login to ubuntu and run below command.

logger "Test Logging"

I can't find the file where this logged in. In my local system I can see the system.log or syslog or messages file in /var/log. But when I check /var/log in container, I can't find any file like this.

root@fbc4ae457ad9:~# ls -al /var/log/
total 316
drwxrwxr-x  6 root syslog   4096 Jun 20 16:49 .
drwxr-xr-x 16 root root     4096 Jun 20 16:42 ..
-rw-r--r--  1 root root     9174 Mar 17 15:17 alternatives.log
drwxr-xr-x  2 root root     4096 Mar 17 15:17 apt
-rw-r--r--  1 root root    47816 Mar 15 04:34 bootstrap.log
-rw-rw----  1 root utmp      768 Jun 20 16:49 btmp
-rw-r-----  1 root adm        31 Mar 15 04:34 dmesg
-rw-r--r--  1 root root   213169 Mar 17 15:17 dpkg.log
-rw-r--r--  1 root root     3296 Mar 17 15:17 faillog
drwxr-xr-x  2 root root     4096 Mar 15 04:34 fsck
-rw-rw-r--  1 root utmp    30076 Jun 20 16:53 lastlog
drwxr-xr-x  2 root root     4096 Apr 11  2014 upstart
-rw-rw-r--  1 root utmp     1920 Jun 20 16:53 wtmp

I check in upstart and other directory, but all are empty.

Which file I have to check for systemlog ?

like image 352
Nilesh Avatar asked Jun 20 '16 17:06

Nilesh


People also ask

How do I view docker logs in Ubuntu?

You find these JSON log files in the /var/lib/docker/containers/ directory on a Linux Docker host. The <container_id> here is the id of the running container. If you're not sure which id is related to which container, you can run the docker ps command to list all running containers.

Where are docker console logs stored?

Where Are Docker Logs Stored By Default? The logging driver enables you to choose how and where to ship your data. The default logging driver as I mentioned above is a JSON file located on the local disk of your Docker host: /var/lib/docker/containers/[container-id]/[container-id]-json.


1 Answers

There is no rsyslogd installed by default, nor in this image you are using.

If you wish to utilize rsyslogd in your docker container, you should install/configure it by your self via Dockerfile first.

RUN apt-get -y install rsyslog

You will probably need supervisord as well to have all your processes started in container.

like image 116
seven Avatar answered Sep 19 '22 20:09

seven