Redirect several log files in docker container to stdout (legacy application)

I have to put legacy application into Docker container. The app is running fine but I cannot display all the log files. The problem is that the app is creating several log files (e.g. service.log, license.log, security.log etc.) AFTER starting the executable.

I have a starting script (let’s call it which prepares some things (links, config) and then starts the app which creates the mentioned log files.

  • docker: gitlab + traefik & port 22
  • Google Cloud Container: Create a docker container from a Dockerfile
  • Graylog docker container only binds when it listens to and not
  • How to start service in docker container at start up
  • Adding config file in docker run command
  • docker running in vmware gets x509 error
  • After some googling I have found similar problem and try to apply the solution that uses named pipes (creating link to /proc/1/fd/1 did not worked). So I placed the following in the starting script:

    mkfifo /path/to/app/license.log && tail -f /path/to/app/license.log &
    mkfifo /path/to/app/security.log && tail -f /path/to/app/security.log &

    but the problem is that only FIRST file will be redirected to docker logs. The others are not visible at all.

    The curious thing is that in I have a line source which executes some specific commands depending on environment. Placing the mkfifo license.log in the and the mkfifo service.log in the works.
    The problem is that I have more files and do not want to source all of them.

    Does anyone have an idea how to solve this?

  • docker COPY .env file fail
  • How best to use Docker in continuous delivery?
  • Docker commit without running
  • bluemix “docker images” results in “json: cannot unmarshal string into Go value of type int”
  • Accessing a MariaDB in one Docker from another Docker
  • JFrog Artifactory REST API access using X-JFrog-Art-Api
  • One Solution collect form web for “Redirect several log files in docker container to stdout (legacy application)”

    Because it is a legacy application we still have to have the log files in place. In that case the solution that works for me is to create the files by touch and read them using tail:

    touch /path/to/app/logfile.log && tail -f /path/to/app/logfile.log &

    So replacing mkfifo with touch solved my problem.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.