Docker Cookbook


Using a Different Logging Driver than the Docker Daemon | 281



Download 6,31 Mb.
Pdf ko'rish
bet221/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   217   218   219   220   221   222   223   224   ...   260
Bog'liq
Docker Cookbook

9.5 Using a Different Logging Driver than the Docker Daemon | 281


Discussion
In the solution section, you ran 
td-agent
as a local service on the Docker host. You
could also run it in a local container. Let’s write a configuration file in your working
directory called 
test.conf
that contains the following:

type forward


type stdout

Then let’s start a 
fluentd
container. You specify a volume mount to put your configu‐
ration file in the running container and specify an environment variable that points
to this file:
$ docker run -it -d -p 24224:24224 -v /path/to/conf:/fluentd/etc \
-e FLUENTD_CONF=test.conf fluent/fluentd:latest
By default, the 
fluentd
logging driver tries to reach a 
fluentd
server on localhost at
port 24224. Therefore, if you run another container with the 
--log-driver=fluentd
option, it will automatically reach 
fluentd
running in the container.
Now start an Nginx container as you did earlier and watch the logs on the Fluentd
container with 
docker logs
.
See Also
• Configuring logging 
drivers
• Fluentd logging driver for Docker 
documentation
9.6 Using Logspout to Collect Container Logs
Problem
Container logs can be obtained from 
docker logs
, as seen in 
Recipe 9.4
, but you
would like to collect these logs from containers running in multiple Docker hosts and
aggregate them.
Solution
Use 
logspout
. Logspout can collect logs from all containers running on a host and
route them to another host. It runs as a container and is purely stateless. You can use
it to route logs to a syslog server or send it to 
Logstash
 for processing. Logspout was
created prior to the release of Docker 1.6, which introduced the logging driver (see

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   217   218   219   220   221   222   223   224   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish