# Logs messages as JSON when log.format=json & log.timestamp=true is passed

exec bash -x ./test.sh &
exec karma --log.format=json --log.timestamp=true --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8064
! stdout .
stderr '{"time":"[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+.*","level":"INFO","msg":"Version: dev"}'
stderr '{"time":"[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+.*","level":"INFO","msg":"Pulling latest alerts and silences from Alertmanager"}'
wait

-- test.sh --
while [ ! -f karma.pid ]; do sleep 1 ; done
sleep 5
cat karma.pid | xargs kill
