mumoshu / variant2

Turn your bash scripts into a modern, single-executable CLI app today
MIT License
141 stars 11 forks source link

Unable to Produce Log File #8

Closed osterman closed 4 years ago

osterman commented 4 years ago

Unable to write log events to file. I'm following these instructions for a simple log output.

#!/usr/bin/env variant

job "example" {
  description = "Write varfile to terraform moduledir"
  exec {
      command = "echo"
      args = [
        "foobar"
      ]
   }

  log {
    collect {
      condition = event.type == "exec"
      format = "exec=${jsonencode(event.exec)}"
    }

    # When `stream = "stderr" is set, every log event that matched any collect condition is written to stderr as well
    #stream = "stderr"

    file = "log.txt"
  }

}

I was expecting this to output foobar to a file called log.txt.

mumoshu commented 4 years ago

@osterman Seems like log block without a forward block has been ignored by Variant. It should now work.