/IoTEdgeLoggingModule

An Azure IoT Edge Module for sending module logs to Azure

Primary LanguageC#Apache License 2.0Apache-2.0

IoT Edge Logging Module

An Azure IoT Edge Module for collecting edge module logs and pushing them to Azure storage.

This project explored a number of options for achieving centralized logging for IoT Edge modules.

+--------+
|Module 1|+----+
+--------+     |+--------------+     +-------+
               >Logging Module |+--->| Azure |
+--------+     |+--------------+     +-------+
|Module 2|+----+
+--------+

Syslog / RSyslog Logging

Syslog is a great mechanism for passing messages since it's natively supported, extremely simple, and super fast.

We used RSyslog inside a container to receive syslog messages, aggregate them, and send them to an output. This could be a file inside the container, or it could be any of many output modules.

More details on configuring a container to use syslog, or for configuring IoT Edge can be found here.

Pros:

  • Simple
  • High performance
  • Included by default

Fluentd Logging

FluentdClient contains a proof of concept for using the Fluentd logging driver with Docker and send those logs to a Fluentd listener. This is a robust solution that many are familiar with. More configuration details can be found here.

Pros:

  • Fluentd is already used by many projects
  • A wide variety of output plugins to integrate with your existing solution.

Cons:

  • Not supported on Nano Server or Windows IoT Core

IoT Edge Configuration

In your deployment manifest, look for the runtime.settings.loggingOptions property. This is a stringified JSON containing the logging options for the Edge agent container:

{
    "log-driver": "syslog",
    "log-opts": {
        "syslog-address": "tcp://127.0.0.1:32795"
    }
}

Custom Logging Driver

Unfortunately, custom logging drivers for Docker are not supported on Windows.

Related Links for Docker Logging