What is the difference between local and json logging drivers?

Viewed 381

Both, JSON and local logging drivers, seem to store logs per container, locally.

In JSON driver docs, I see the extra options of labels and env (because JSON can have attributes?). Also, local driver documentation says that it uses "internal storage". But I could not find what the fundamental difference is.

1 Answers

In documentation:

  • local Logs are stored in a custom format designed for minimal overhead.
  • json-file The logs are formatted as JSON. The default logging driver for Docker.

Explanation:

  • local => log saved as is writed.

  • json-file => formated to:

{
     "log":"log message",
     "stream":"stdout",
     "time":"2019-10-12T12:44:45.931849055Z"
}
Related