Sebastiaan van Stijn 18b289f9df daemon/server: fix requests not logged with --log-level=trace
Before this patch, debug and trace-level logs were enabled, but the debugging
middleware was not, the request-body was not logged when enabling trace-level
logs:

    INFO[2025-09-16T07:55:07.500241927Z] Daemon has completed initialization
    INFO[2025-09-16T07:55:07.500267802Z] API listen on /var/run/docker.sock
    TRAC[2025-09-16T07:55:08.502387094Z] garbage collected                             d="437.583µs"
    DEBU[2025-09-16T07:55:13.215510096Z] stat snapshot                                 key="sha256:6aba5e0d32d91e3e923854dcb30588dc4112bfa1dae82b89535ad31d322a7b19" snapshotter=overlayfs
    DEBU[2025-09-16T07:55:13.216532430Z] prepare snapshot                              key=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485-init-key parent="sha256:6aba5e0d32d91e3e923854dcb30588dc4112bfa1dae82b89535ad31d322a7b19" snapshotter=overlayfs
    TRAC[2025-09-16T07:55:13.219691055Z] event published                               ns=moby topic=/snapshot/prepare type=containerd.events.SnapshotPrepare
    DEBU[2025-09-16T07:55:13.226507180Z] commit snapshot                               key=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485-init-key name=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485-init snapshotter=overlayfs
    TRAC[2025-09-16T07:55:13.227871055Z] event published                               ns=moby topic=/snapshot/commit type=containerd.events.SnapshotCommit
    DEBU[2025-09-16T07:55:13.228132471Z] prepare snapshot                              key=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485 parent=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485-init snapshotter=overlayfs
    TRAC[2025-09-16T07:55:13.229071055Z] event published                               ns=moby topic=/snapshot/prepare type=containerd.events.SnapshotPrepare
    DEBU[2025-09-16T07:55:13.229489180Z] get snapshot mounts                           key=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485 snapshotter=overlayfs
    DEBU[2025-09-16T07:55:13.229824721Z] container mounted via snapshotter             container=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485 root=/var/lib/docker/rootfs/overlayfs/80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485 snapshotter=overlayfs
    DEBU[2025-09-16T07:55:13.229849096Z] container mounted via layerStore              container=80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485 root=/var/lib/docker/rootfs/overlayfs/80813e376c0610bcd3fc1cbe7b6b1f3427a22eca06e4d34f6d5fb9c4d4589485 storage-driver=overlayfs

With this patch applied, the debugging middleware is enabled both with
debug- and trace-level logging enabled:

    INFO[2025-09-16T07:56:31.024794341Z] Daemon has completed initialization
    INFO[2025-09-16T07:56:31.024856591Z] API listen on /var/run/docker.sock
    TRAC[2025-09-16T07:56:32.026944049Z] garbage collected                             d="640.167µs"
    DEBU[2025-09-16T07:56:36.729870218Z] handling HEAD request                         method=HEAD module=api request-url=/_ping vars="map[]"
    DEBU[2025-09-16T07:56:36.731114885Z] handling POST request                         form-data="{\"AttachStderr\":true,\"AttachStdin\":false,\"AttachStdout\":true,\"Cmd\":null,\"Domainname\":\"\",\"Entrypoint\":null,\"Env\":null,\"HostConfig\":{\"AutoRemove\":false,\"Binds\":null,\"BlkioDeviceReadBps\":[],\"BlkioDeviceReadIOps\":[],\"BlkioDeviceWriteBps\":[],\"BlkioDeviceWriteIOps\":[],\"BlkioWeight\":0,\"BlkioWeightDevice\":[],\"CapAdd\":null,\"CapDrop\":null,\"Cgroup\":\"\",\"CgroupParent\":\"\",\"CgroupnsMode\":\"\",\"ConsoleSize\":[23,104],\"ContainerIDFile\":\"\",\"CpuCount\":0,\"CpuPercent\":0,\"CpuPeriod\":0,\"CpuQuota\":0,\"CpuRealtimePeriod\":0,\"CpuRealtimeRuntime\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\"CpusetMems\":\"\",\"DeviceCgroupRules\":null,\"DeviceRequests\":null,\"Devices\":[],\"Dns\":[],\"DnsOptions\":[],\"DnsSearch\":[],\"ExtraHosts\":null,\"GroupAdd\":null,\"IOMaximumBandwidth\":0,\"IOMaximumIOps\":0,\"IpcMode\":\"\",\"Isolation\":\"\",\"Links\":null,\"LogConfig\":{\"Config\":{},\"Type\":\"\"},\"MaskedPaths\":null,\"Memory\":0,\"MemoryReservation\":0,\"MemorySwap\":0,\"MemorySwappiness\":-1,\"NanoCpus\":0,\"NetworkMode\":\"default\",\"OomKillDisable\":false,\"OomScoreAdj\":0,\"PidMode\":\"\",\"PidsLimit\":0,\"PortBindings\":{},\"Privileged\":false,\"PublishAllPorts\":false,\"ReadonlyPaths\":null,\"ReadonlyRootfs\":false,\"RestartPolicy\":{\"MaximumRetryCount\":0,\"Name\":\"no\"},\"SecurityOpt\":null,\"ShmSize\":0,\"UTSMode\":\"\",\"Ulimits\":[],\"UsernsMode\":\"\",\"VolumeDriver\":\"\",\"VolumesFrom\":null},\"Hostname\":\"\",\"Image\":\"busybox\",\"Labels\":{},\"NetworkingConfig\":{\"EndpointsConfig\":{\"default\":{\"Aliases\":null,\"DNSNames\":null,\"DriverOpts\":null,\"EndpointID\":\"\",\"Gateway\":\"\",\"GlobalIPv6Address\":\"\",\"GlobalIPv6PrefixLen\":0,\"GwPriority\":0,\"IPAMConfig\":null,\"IPAddress\":\"\",\"IPPrefixLen\":0,\"IPv6Gateway\":\"\",\"Links\":null,\"MacAddress\":\"\",\"NetworkID\":\"\"}}},\"OnBuild\":null,\"OpenStdin\":false,\"StdinOnce\":false,\"Tty\":false,\"User\":\"\",\"Volumes\":{},\"WorkingDir\":\"\"}" method=POST module=api request-url=/v1.51/containers/create vars="map[version:1.51]"
    DEBU[2025-09-16T07:56:36.751584218Z] stat snapshot                                 key="sha256:6aba5e0d32d91e3e923854dcb30588dc4112bfa1dae82b89535ad31d322a7b19" snapshotter=overlayfs
    DEBU[2025-09-16T07:56:36.752634302Z] prepare snapshot                              key=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41-init-key parent="sha256:6aba5e0d32d91e3e923854dcb30588dc4112bfa1dae82b89535ad31d322a7b19" snapshotter=overlayfs
    TRAC[2025-09-16T07:56:36.755453593Z] event published                               ns=moby topic=/snapshot/prepare type=containerd.events.SnapshotPrepare
    DEBU[2025-09-16T07:56:36.827076427Z] commit snapshot                               key=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41-init-key name=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41-init snapshotter=overlayfs
    TRAC[2025-09-16T07:56:36.828276635Z] event published                               ns=moby topic=/snapshot/commit type=containerd.events.SnapshotCommit
    DEBU[2025-09-16T07:56:36.828467885Z] prepare snapshot                              key=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41 parent=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41-init snapshotter=overlayfs
    TRAC[2025-09-16T07:56:36.829163010Z] event published                               ns=moby topic=/snapshot/prepare type=containerd.events.SnapshotPrepare
    DEBU[2025-09-16T07:56:36.829448927Z] get snapshot mounts                           key=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41 snapshotter=overlayfs
    DEBU[2025-09-16T07:56:36.829850302Z] container mounted via snapshotter             container=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41 root=/var/lib/docker/rootfs/overlayfs/786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41 snapshotter=overlayfs
    DEBU[2025-09-16T07:56:36.829872593Z] container mounted via layerStore              container=786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41 root=/var/lib/docker/rootfs/overlayfs/786e5174c57aa5057b4fd0a3c01013fe98d6fa3e5aaf9f1f89224175be74ba41 storage-driver=overlayfs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-16 10:01:10 +02:00
2025-09-15 12:02:21 +02:00
2025-08-26 13:14:36 +02:00
2025-07-22 19:15:02 +01:00
2025-08-08 00:24:37 +02:00
2025-09-03 20:31:17 +02:00
2025-09-04 22:53:40 -07:00
2025-09-05 23:44:35 +02:00
2025-09-03 20:31:17 +02:00
2025-09-03 20:31:17 +02:00
2018-09-12 14:27:53 +01:00
2019-07-29 16:59:08 -07:00
2025-08-01 01:48:55 +02:00
2024-08-02 10:01:48 +02:00
2025-09-03 20:31:17 +02:00

The Moby Project

PkgGoDev GitHub License Go Report Card OpenSSF Scorecard OpenSSF Best Practices

Moby Project logo

Moby is an open-source project created by Docker to enable and accelerate software containerization.

It provides a "Lego set" of toolkit components, the framework for assembling them into custom container-based systems, and a place for all container enthusiasts and professionals to experiment and exchange ideas. Components include container build tools, a container registry, orchestration tools, a runtime and more, and these can be used as building blocks in conjunction with other tools and projects.

Principles

Moby is an open project guided by strong principles, aiming to be modular, flexible and without too strong an opinion on user experience. It is open to the community to help set its direction.

  • Modular: the project includes lots of components that have well-defined functions and APIs that work together.
  • Batteries included but swappable: Moby includes enough components to build fully featured container systems, but its modular architecture ensures that most of the components can be swapped by different implementations.
  • Usable security: Moby provides secure defaults without compromising usability.
  • Developer focused: The APIs are intended to be functional and useful to build powerful tools. They are not necessarily intended as end user tools but as components aimed at developers. Documentation and UX is aimed at developers not end users.

Audience

The Moby Project is intended for engineers, integrators and enthusiasts looking to modify, hack, fix, experiment, invent and build systems based on containers. It is not for people looking for a commercially supported system, but for people who want to work and learn with open source code.

Relationship with Docker

The components and tools in the Moby Project are initially the open source components that Docker and the community have built for the Docker Project. New projects can be added if they fit with the community goals. Docker is committed to using Moby as the upstream for the Docker Product. However, other projects are also encouraged to use Moby as an upstream, and to reuse the components in diverse ways, and all these uses will be treated in the same way. External maintainers and contributors are welcomed.

The Moby project is not intended as a location for support or feature requests for Docker products, but as a place for contributors to work on open source code, fix bugs, and make the code more useful. The releases are supported by the maintainers, community and users, on a best efforts basis only. For customers who want enterprise or commercial support, Docker Desktop and Mirantis Container Runtime are the appropriate products for these use cases.


Legal

Brought to you courtesy of our legal counsel. For more context, please see the NOTICE document in this repo.

Use and transfer of Moby may be subject to certain restrictions by the United States and other governments.

It is your responsibility to ensure that your use and/or transfer does not violate applicable laws.

For more information, please see https://www.bis.doc.gov

Licensing

Moby is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Description
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
Readme 524 MiB
Languages
Go 97.5%
Shell 1.2%
Dockerfile 0.6%
PowerShell 0.2%
Lua 0.2%
Other 0.1%