Sending Docker Container Logs to Azure Application Insights Using GELF Driver

Docker has a default logging driver, which each container uses. However, you can configure the Docker daemon, or for that matter a Docker container to use a different logging driver. One such driver is Graylog Extended Format logging driver. The Graylog Extended Log Format (GELF) is understood by a number of tools such as Graylog, Logstash, Fluentd, etc. But you can write your own GELF server, which is basically an UDP server. Once you get the GELF message in the UDP server, you can send the message to where you want and for this post, I use Azure Application Insights. Of course, you can create your own Docker logging driver too but I use the GELF driver because it is less work to do! I do not know what the legal/license implications are, in terms of using the GELF driver With Azure Application Insights but the point of this post is to illustrate what is possible.
Continue reading