How to configure my docker container to use a different logging driver?

0 votes

I don't want to use the default logging driver (json-file) as the logging driver for my docker container.How can I run my docker container to use a different logging driver?

Jul 4, 2019 in Docker by Angad
194 views

1 answer to this question.

0 votes

When you start a docker container, you can configure it to use a different logging driver than the Docker daemon’s default logging driver( json-file), using the --log-driver flag.Even if the container uses the default logging driver, it can use different configurable options.Say Suppose you want your docker container to use logging driver "gcplogs" instead of the default, you can do it by using the following command:

$ docker run -it --log-driver gcplogs alpine ash

Similarly you could configure it to use any other logging driver like splunk, local, syslog or you can make it none in case you don't need logs for a particular docker container.

answered Jul 4, 2019 by Sirajul
• 55,750 points

Related Questions In Docker

+1 vote
0 answers

How can I map a docker location to my Jenkins workspace so that I can use the files in my Jenkins

Hey guys, I was trying to execute few ...READ MORE

Feb 25 in Docker by dineshkumar
• 130 points
1,112 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,200 points

edited Oct 16, 2018 by lina 14,255 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,940 points
1,146 views
0 votes
1 answer

How to continue running a docker container which is already exited?

Restart an existing container after you exited ...READ MORE

answered Jul 19, 2018 in Docker by Sophie may
• 9,940 points
841 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,550 points
673 views
0 votes
2 answers

How to execute docker exec commande inside a docker container ?

You need to get inside the container ...READ MORE

answered Aug 13, 2019 in Docker by Sirajul
• 55,750 points
907 views
0 votes
2 answers

How do I copy a file from docker container to host?

Instead of using docker run you could ...READ MORE

answered Aug 13, 2019 in Docker by Sirajul
• 55,750 points
17,544 views