Wednesday, November 4, 2015


Logfile is a file that records either events that occur in an operating system or other software runs, or messages between different users of a communication software.Logging is the act of keeping a log. In the simplest case, messages are written to a single logfile. more...

A simple node console and file logger suitable for small, medium and large projects.To this we need to install simple-node-logger node modules.To that type this in your command line.
npm install simple-node-logger --save

To create a logger in console view :
var log = require('simple-node-logger').createSimpleLogger();
To create a logger in separate file project.log in your working directory:
var log = require('simple-node-logger').createSimpleLogger('project.log');

In the log have some levels include the standard set: trace, debug, info, warn, error and fatal levels (plus all and off). The default level is info. The log level can be set at run-time by doing this:
warn to set the log level see here:
log.setLevel('warn');

Sample log here:
var log = require('simple-node-logger').createSimpleLogger();
log.info("Log starting...");
log.warn("This is warning");
log.info("THis is info");


Category Logger

If you create a logger with a category name, all log statements will include this category. Typically a category is a class or module name. If you create a logger with the category name 'MyCategory', the log statement would format like this:
14:14:21.363 INFO  MyCategory subscription to

A simple multi-level logger for console, file, and rolling file appenders. Features include:
  • flexible appender/formatters with default to HH:MM:ss.SSS LEVEL message
  • add appenders to send output to console, file, rolling file, etc
  • change log levels on the fly
  • domain and category columns
  • overridable format methods in base appender

0 comments:

Post a Comment

Popular Posts

Recent Posts

Unordered List

Text Widget

Powered by Blogger.

Popular Posts