adamkewley / jobson

A platform for transforming command-line applications into a job service.
Apache License 2.0
256 stars 20 forks source link

Log to file - missing docs on the logging config parameter #53

Closed mtazzari closed 5 years ago

mtazzari commented 5 years ago

I wanted to log to file as well, not only on the console. This is useful, e.g., when using jobson in docker to store the log to a volume or to a bind-mounted host directory. I couldn't find any docs on how to extend the logging parameter in the config.yml file. By playing around with the config file and checking the errors in the console I saw that jobson uses the dropwizard framework. I went to the dropwizard docs and I found this solution: https://www.dropwizard.io/0.7.1/docs/manual/configuration.html#logging So, this works:

logging:
  level: INFO
  appenders:
    - type: file
      currentLogFilename: /var/log/myapplication.log
      threshold: ALL
      archive: true
      archivedLogFilenamePattern: /var/log/myapplication-%d.log
      archivedFileCount: 5
      timeZone: UTC
      logFormat: # TODO

It would be great to have an example or at least a reference to this in the docs.

adamkewley commented 5 years ago

Thanks for this feedback: I'll try and put a link to the exact dropwizard configuration jobson has inherited.