Search code examples
node.jsloggingconfigurationforever

Specifying logging options in forever JS config file


The github readme of forever.js states

In addition to passing forever the path to a script (along with accompanying options, described above), you may also pass forever the path to a JSON file containing these options. For example, consider an application with the following file structure:

In the following example, the options uid, append, watch, script and sourceDir are set. All of these are long versions of arguments to the forever command (with the short versions being -a, -w, -s).

My problem is: some of the options to forever don't have a long version, for example -m, -l, -e, -o. How do I provide these options in my json configuration file?

I've tried adding values to keys such as "l" and "log", but this didn't achieve the desired effect.


Solution

  • It seems like the JSON properties for all shorthand options are listed here. For example, the JSON property for -p would be "path".

    var argvOptions = cli.argvOptions = {
      'command':   {alias: 'c'},
      'errFile':   {alias: 'e'},
      'logFile':   {alias: 'l'},
      'killTree':  {alias: 't', boolean: true},
      'append':    {alias: 'a', boolean: true},
      'fifo':      {alias: 'f', boolean: true},
      'number':    {alias: 'n'},
      'max':       {alias: 'm'},
      'outFile':   {alias: 'o'},
      'path':      {alias: 'p'},
      'help':      {alias: 'h'},
      'silent':    {alias: 's', boolean: true},
      'verbose':   {alias: 'v', boolean: true},
      'watch':     {alias: 'w', boolean: true},
      'debug':     {alias: 'd', boolean: true},
      'plain':     {boolean: true},
      'uid':       {alias: 'u'}
    };