Skip to content
This repository was archived by the owner on Aug 10, 2020. It is now read-only.
This repository was archived by the owner on Aug 10, 2020. It is now read-only.

Log files #8

Open
Open

Description

@rahul286
  • Can we access log files as it is? From host location?
  • Does docker logs exposes some magic?

Activity

  1. vishaldodiya commented on Dec 29, 2017

    @vishaldodiya

    Can we access log files as it is? From host location?

    One can map log files from docker container to host files. for example,

      nginx:
        image: nginx:latest
        depends_on:
          - php
        restart: always
        ports:
          - "80:80"
        volumes:
          - "./wordpress:/var/www/html"
          - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf"
          - "./config/nginx/log/error.log:/var/log/nginx/error.log"
          - "./config/nginx/log/access.log:/var/log/nginx/access.log"
    

    Does docker logs exposes some magic?

    In docker logs command one can get log from specific container using container name or container id, like

    $ docker logs -f <container_id>/<container_name>
    

    Reference https://docs.docker.com/engine/reference/commandline/logs/


    Also one can use docker-compose log to get logs from all services.
    Reference https://docs.docker.com/compose/reference/logs/

  2. rahul286 commented on Dec 29, 2017

    @rahul286
    MemberAuthor

    @vishaldodiya Thanks for adding details.

    If you like to send a PR, that would be great! :)

  3. mbtamuli commented on Dec 29, 2017

    @mbtamuli
    Contributor

    In addition to what @vishaldodiya said, for docker-compose, we can see the logs from all containers using

    docker-compose logs -f
    

    with the -f flag for tail ing the logs.

    This is already added in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions