1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/server
Doug Davis 8b454dd79e Add a "context" to the api/server/* code
This defines a 'context' object that is passed to each API handler.
Right now the context just has a unique 'requestID' for each API call.
The next steps would be:
- use this 'requestID' in our logging.
- determine the best way to format the logging to include this info.

In particular for log events that generate multiple entries in the log
we can use the requestID to help correlate the log entries.

Adding the requestID to the logging will be a challenge since it could mean
changing every single logrus.XXX() call to pass in the 'context' object.

But first step is to agree on a format, which we can discus in a subsequent
PR, but my initial thoughts are to add it right after the timestamp:

current format:
INFO[0039] POST /v1.21/build?buildargs=%7B%22foo%22%3A%22xxx%22%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=&ulimits=null

proposed format:
INFO[0039-83dea1222191] POST /v1.21/build?buildargs=%7B%22foo%22%3A%22xxx%22%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=&ulimits=null

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-09 12:51:20 -07:00
..
auth.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
container.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
copy.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
daemon.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
exec.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
form.go Windows - make docker cp functional 2015-08-06 11:22:38 -07:00
form_test.go Fix regression in stats API endpoint where stream query param default is true 2015-05-29 22:38:36 +02:00
image.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
inspect.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
profiler.go api/server fix golint errors/warnings. 2015-07-28 22:44:39 +00:00
server.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00
server_experimental_unix.go Vendoring libnetwork 3e31cead05cba8ec20241630d051e6d73765b3a2 2015-09-08 07:36:35 -07:00
server_stub.go Mark network ui endpoints unix-only 2015-08-10 21:49:27 -07:00
server_unix.go Move VolumeDriver to HostConfig to make containers portable. 2015-09-04 12:42:44 -04:00
server_windows.go Move VolumeDriver to HostConfig to make containers portable. 2015-09-04 12:42:44 -04:00
volume.go Add a "context" to the api/server/* code 2015-09-09 12:51:20 -07:00