is log_driver must even for "json-file"?

15 views
Skip to first unread message

kavya KULSHRESHTHA

unread,
Jul 24, 2017, 6:02:29 AM7/24/17
to Ansible Project
 Hi,

I started a container using ansible without specifying log-driver as "json-file" is the default one, but I added below log_options:

    log_options:
      max-size: "10m"
      max-file: "2"
      
Ansible version:  2.2.1.0

What I expected?
Container should run with these log_options as json-file is default

What I found?
docker inspect showed no log_options were configred.
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },


Upon specifying "json-file" as the log_driver, I was able to see log_options.
Playbook:
    log_driver: "json-file"
    log_options:
      max-size: "10m"
      max-file: "2"

docker inspect:
            "LogConfig": {
                "Type": "json-file",
                "Config": {
                    "max-file": "2",
                    "max-size": "10m"
                }

Doesnt Ansible assumes default log_driver like docker does?

Regards,
Kavya K
Reply all
Reply to author
Forward
0 new messages