You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-edge/production-checklist.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,7 @@ If your devices are going to be deployed on a network that uses a proxy server,
246
246
247
247
***Helpful**
248
248
* Set up logs and diagnostics
249
-
*Place limits on log size
249
+
*Set up default logging driver
250
250
* Consider tests and CI/CD pipelines
251
251
252
252
### Set up logs and diagnostics
@@ -285,17 +285,24 @@ Starting with version 1.2, IoT Edge relies on multiple daemons. While each daemo
285
285
286
286
When you're testing an IoT Edge deployment, you can usually access your devices to retrieve logs and troubleshoot. In a deployment scenario, you may not have that option. Consider how you're going to gather information about your devices in production. One option is to use a logging module that collects information from the other modules and sends it to the cloud. One example of a logging module is [logspout-loganalytics](https://github.com/veyalla/logspout-loganalytics), or you can design your own.
287
287
288
-
### Place limits on log size
288
+
### Set up default logging driver
289
289
290
-
By default the Moby container engine does not set container log size limits. Over time this can lead to the device filling up with logs and running out of disk space. Consider the following options to prevent this:
290
+
By default, the Moby container engine does not set container log size limits. Over time, this can lead to the device filling up with logs and running out of disk space. Configure your container engine to use the [`local` logging driver](https://docs.docker.com/config/containers/logging/local/) as your logging mechanism. `Local` logging driver offers a default log size limit, performs log-rotation by default, and uses a more efficient file format which helps to prevent disk space exhaustion. You may also choose to use different [logging drivers](https://docs.docker.com/config/containers/logging/configure/) and set different size limits based on your need.
291
291
292
-
#### Option: Set global limits that apply to all container modules
292
+
#### Option: Configure the default logging driver for all container modules
293
293
294
-
You can limit the size of all container logfiles in the container engine log options. The following example sets the log driver to `json-file` (recommended) with limits on size and number of files:
294
+
You can configure your container engine to use a specific logging driver by setting the value of `log driver` to the name of the log driver in the `daemon.json`. The following example sets the default logging driver to the `local` log driver (recommended).
295
295
296
296
```JSON
297
297
{
298
-
"log-driver": "json-file",
298
+
"log-driver": "local"
299
+
}
300
+
```
301
+
You can also configure your `log-opts` keys to use appropriate values in the `daemon.json` file. The following example sets the log driver to `local` and sets the `max-size` and `max-file` options.
302
+
303
+
```JSON
304
+
{
305
+
"log-driver": "local",
299
306
"log-opts": {
300
307
"max-size": "10m",
301
308
"max-file": "3"
@@ -332,7 +339,7 @@ You can do so in the **createOptions** of each module. For example:
Copy file name to clipboardExpand all lines: articles/iot-edge/troubleshoot.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ sudo iotedge check
54
54
55
55
The troubleshooting tool runs many checks that are sorted into these three categories:
56
56
57
-
**Configuration checks*examines details that could prevent IoT Edge devices from connecting to the cloud, including issues with the config file and the container engine.
57
+
**Configuration checks*examine details that could prevent IoT Edge devices from connecting to the cloud, including issues with the config file and the container engine.
58
58
**Connection checks* verify that the IoT Edge runtime can access ports on the host device and that all the IoT Edge components can connect to the IoT Hub. This set of checks returns errors if the IoT Edge device is behind a proxy.
59
59
**Production readiness checks* look for recommended production best practices, such as the state of device certificate authority (CA) certificates and module log file configuration.
60
60
@@ -293,7 +293,7 @@ If you're still troubleshooting, wait until after you've inspected the container
293
293
docker rm --force <container name>
294
294
```
295
295
296
-
For ongoing logs maintenance and production scenarios, [place limits on log size](production-checklist.md#place-limits-on-log-size).
296
+
For ongoing logs maintenance and production scenarios, [Set up default logging driver](production-checklist.md#set-up-default-logging-driver).
297
297
298
298
## View the messages going through the IoT Edge hub
Copy file name to clipboardExpand all lines: includes/iot-edge-install-linux.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,8 +73,18 @@ Install the Moby engine.
73
73
sudo apt-get update; \
74
74
sudo apt-get install moby-engine
75
75
```
76
-
77
76
---
77
+
Once the Moby engine is successfully installed, configure it to use [`local` logging driver](https://docs.docker.com/config/containers/logging/local/) as the logging mechanism. To learn more about logging configuration, see [Production Deployment Checklist](../articles/iot-edge/production-checklist.md#set-up-default-logging-driver).
78
+
79
+
* Create or open the Docker daemon's config file at `/etc/docker/daemon.json`.
80
+
* Set the default logging driver to the `local` logging driver as shown in the example below.
81
+
82
+
```JSON
83
+
{
84
+
"log-driver": "local"
85
+
}
86
+
```
87
+
* Restart the container engine for the changes to take effect.
78
88
79
89
> [!TIP]
80
90
> If you get errors when you install the Moby container engine, verify your Linux kernel for Moby compatibility. Some embedded device manufacturers ship device images that contain custom Linux kernels without the features required for container engine compatibility. Run the following command, which uses the [check-config script](https://github.com/moby/moby/blob/master/contrib/check-config.sh) provided by Moby, to check your kernel configuration:
0 commit comments