使用Docker& amp;抑制请求输出帆船

时间:2016-07-28 00:59:10

标签: docker docker-compose dinghy

我正在使用dinghy与docker和docker-compose。我有一个docker image for fake_sqs,我正在装载我的码头作品,如下所示:

fakesqs:
  image: link664/fakesqs-docker
  command: bundle exec fake_sqs -n fakesqs -p 4568
  environment:
    VIRTUAL_HOST: aws.docker

我还有一个运行并连接到图像的轮询器脚本:

poller:
  build: poller/.
  command: script/poller
  volumes:
    - ./poller:/app
  links:
    - fakesqs
  environment:
    AWS_QUEUE_NAME: my-queue
    AWS_ENDPOINT: http://fakesqs:4568/

这一切都很愉快。轮询器可以读取fake_sqs并且它一切都很好。我遇到的问题是,每次轮询器到达队列(每秒几次)时,它会将请求记录到stdout:

fakesqs_1    | [2016-07-27 07:59:29] INFO  WEBrick 1.3.1
fakesqs_1    | [2016-07-27 07:59:29] INFO  ruby 2.2.3 (2015-08-18) [x86_64-linux]
fakesqs_1    | == Sinatra (v1.4.7) has taken the stage on 4568 for development with backup from WEBrick
fakesqs_1    | [2016-07-27 07:59:29] INFO  WEBrick::HTTPServer#start: pid=1 port=4568
poller_1     | Creating queue my-queue
fakesqs_1    | 172.17.0.11 - - [27/Jul/2016:08:00:00 UTC] "POST / HTTP/1.1" 200 273
fakesqs_1    | - -> /
poller_1     | Initializing poller for queue http://fakesqs:4568/my-queue
poller_1     | Polling ...
fakesqs_1    | 172.17.0.11 - - [27/Jul/2016:08:00:00 UTC] "POST /my-queue HTTP/1.1" 200 221
fakesqs_1    | - -> /my-queue
fakesqs_1    | 172.17.0.11 - - [27/Jul/2016:08:00:01 UTC] "POST /my-queue HTTP/1.1" 200 221
fakesqs_1    | - -> /my-queue
fakesqs_1    | 172.17.0.11 - - [27/Jul/2016:08:00:01 UTC] "POST /my-queue HTTP/1.1" 200 221
fakesqs_1    | - -> /my-queue
fakesqs_1    | 172.17.0.11 - - [27/Jul/2016:08:00:01 UTC] "POST /my-queue HTTP/1.1" 200 221
fakesqs_1    | - -> /my-queue
fakesqs_1    | 172.17.0.11 - - [27/Jul/2016:08:00:01 UTC] "POST /my-queue HTTP/1.1" 200 221
fakesqs_1    | - -> /my-queue

如何在不完全抑制STDOUT的情况下禁止此请求记录?

1 个答案:

答案 0 :(得分:0)

我相信你需要扩展fakesqs图像并调整日志记录级别。除非您只想禁用所有stdout日志记录,否则无法从Compose控制此操作。