Skip to content

Instantly share code, notes, and snippets.

@philipithomas
Last active October 16, 2015 00:41
Show Gist options
  • Save philipithomas/c50e20f2978013cac85d to your computer and use it in GitHub Desktop.
Save philipithomas/c50e20f2978013cac85d to your computer and use it in GitHub Desktop.
Tech bug
# Goal: write Julia logs to disk and also print to standard out.
# In the process, prepend environment info (staffjoy-scheduler-stage)
# This works in vagrant / dev
/usr/bin/julia -p 2 -e 'import Manager; Manager.run_server()' 2>&1 | awk -v env=$ENV '{ print "staffjoy-scheduler-" env, $0; }' | tee -a scheduler.log
# In docker, the awk fails. The environment variable is defined.
# This is all that works in docker:
/usr/bin/julia -p 2 -e 'import Manager; Manager.run_server()' 2>&1 | tee -a scheduler.log
# This writes to raw.log but not scheduler.log
/usr/bin/julia -p 2 -e 'import Manager; Manager.run_server()' 2>&1 | tee -a raw.log | awk -v env=$ENV '{ print "staffjoy-scheduler-" env, $0; }' | tee -a scheduler.log
# Why can't I get awk to work in docker?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment