What is the prefered size for docker log file on linux machine

Thomas Ansamma, ITP71, BUZ 21 Reputation points
2022-02-18T09:50:31.907+00:00

What is the preferred max-size and max-file values for docker running on linux machine.
Or what are the factors to consider for taking decision on these values.

{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3",

"labels": "production_status",
"env": "os,customer"
}
}

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
598 questions
Developer technologies | .NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 36,766 Reputation points MVP Volunteer Moderator
    2022-02-18T12:18:30.037+00:00

    Hello @Thomas Ansamma, ITP71, BUZ ,

    Azure IoT Edge makes it possible to define logfile limitations. This can be done in the global settings and per module.

    The size limitations depends on eg. the amount of diskspace available, the number of modules, the expected growth of log files, the value of the logging (eg. for development, testing or for production), or the actual information shown in the log (perhaps you do not want to expose too much).

    It's even possible to temporarily overrule the file size (eg. using the deployment manifest) so you can build up more evidence of a certain situation.

    It's a good practice to log in a separate partition/disk so the main OS is not limited due to a disk running full.

    So, just start with some default size, measure the value of it and increase if needed.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.