title: log4js - node package - not writing to file
body: <p>I am novice to nodejs and wanted my node app to log to a file as well as console.</p>
  
  <p>Here is my code structure:</p>
  
  <p><strong>fpa_log4j.json</strong>:</p>
  
  <pre><code>{
    "appenders": {
      "fpa_file": {
        "type": "file",
        "filename": "fpa.log",
        "maxLogSize": 10485760,
        "backups": 10,
        "compress": true
      },
      "screen": {
        "type": "stdout",
        "layout": {
          "type": "coloured"
        }
      }
    },
    "categories": {
      "default": {
        "appenders": [
          "fpa_file",
          "screen"
        ],
        "level": "trace"
      }
    }
  }
  </code></pre>
  
  <p><strong>config.js</strong></p>
  
  <pre><code>var LOG4J_CFG = 'config/fpa_log4j.json';
  var fs = require('fs');
  var log4js = require('log4js');
  var path = require('path');
  
  LOG4J_CFG = path.resolve(LOG4J_CFG);
  log4js.configure(JSON.parse(fs.readFileSync(LOG4J_CFG, 'utf8')));
  ....
  ....
  module.exports = {
      log4js,
      ....
      ....
  }
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var cfg = require('./config');
  var log = cfg.log4js.getLogger("appMain");
  log.info('FPA program STARTED!');
  </code></pre>
  
  <blockquote>
    <p><strong>OUTPUT</strong></p>
  
  <pre><code>[2017-12-04T03:20:17.791] [INFO] appMain - FPA program STARTED!
  </code></pre>
  </blockquote>
  
  <p>However the log file seems to be empty:</p>
  
  <pre><code>dir fpa.log
   Volume in drive C is XXXXXXXXX
   Volume Serial Number is XXXXXXXXXXXX
  
   Directory of c:\fpaMain
  
  12/04/2017  12:13 AM                 0 fpa.log
                 1 File(s)              0 bytes
                 0 Dir(s)  12,242,776,064 bytes free
  </code></pre>
  
  <p>To be frank, I was able to make this work few days back. But then something got changed (alas, not able to recollect what it is!) I guess, and then logging into the file stopped.</p>