title: Node.js Logging
body: <p>Is there any library which will help me to handle logging in my Node.Js application? All I want to do is, I want to write all logs into a File and also I need an options like rolling out the file after certain size or date. </p>
  
  <hr>
  
  <p>I have incorporated log4js im trying to keep all the configuration details in one file and use only the methods in other application files for ease of maintenance.  But it doesnt work as expected. Here is what I'm trying to do</p>
  
  <pre><code>var log4js = require('log4js'); 
  log4js.clearAppenders()
  log4js.loadAppender('file');
  log4js.addAppender(log4js.appenders.file('test.log'), 'test');
  var logger = log4js.getLogger('test');
  logger.setLevel('ERROR');
  
  
  var traceLogger = function (message) {
          logger.trace('message');
      };
  
  var errorLogger = function (message) {
          logger.trace(message);
      };
  
  
  exports.trace = traceLogger;
  exports.error = errorLogger;
  </code></pre>
  
  <p>I have included this file in other files and tried</p>
  
  <pre><code>log.error ("Hello Error Message");
  </code></pre>
  
  <p>But it is not working. Is there anything wrong in this ?</p>