dockerize icon indicating copy to clipboard operation
dockerize copied to clipboard

Set logging level

Open wrathagom opened this issue 7 years ago • 2 comments

I'm using Dockerize in an open source project that my team is developing. I was curious if there was a way to quiet the logging output so that I get errors/timeouts, but not the delay message every 1 second.

I know I can turn logging off for the container, but still want to see the errors.

https://github.com/samtecspg/conveyor/blob/master/channel-sources/Dockerfile#L10

wrathagom avatar Feb 17 '18 13:02 wrathagom

There isn't a way to do this currently.

jwilder avatar Mar 17 '18 20:03 jwilder

You can redirect stderr and get stdout messages. We're using with apt-cacher-ng with an autodetect.sh for apt in the following way:

#!/bin/bash

descobre_se_ha_cache_apt_disponivel_e_retorna_o_valor_esperado_pelo_apt () {
    dockerize -stdout=/dev/null -stderr=/dev/null -wait tcp://apt-cacher:3142 --timeout 5s && echo -n "http://apt-cacher:3142" || echo -n "DIRECT"
}

descobre_se_ha_cache_apt_disponivel_e_retorna_o_valor_esperado_pelo_apt 2>/dev/null

The output is simply "DIRECT" or the apt-cacher addr.

gcavalcante8808 avatar Oct 23 '19 18:10 gcavalcante8808