Skip to content

aquajs/aquajs-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aqua Js Logger

Aqua JS Logger framework: Currently Aqua Js Logging Framework supports logging to Console, File, Rolling File, Email, PREGOG, MongoDB, Redis, Database Logging.

Configuration (specify the logger config for the environment) :

Simple example - a logger for console and file logging :

  • sample log_config.json is provided by the framework.
var loggerConfig = require('./log_config.json');
AquaJsLogger = require('aquajs-logger');
AquaJsLogger.init(loggerConfig);

logger = AquaJsLogger.getLogger();
logger.info("get my Details");

logger = require('aquajs-logger').getLogger();
logger.info("get my Details");

Use the Logger :

logger.info("Server Listing on the port:" + config.port);
logger.error ("Invalid Data Type");

Other Logger Configuration Attributes :

  • Console logging attributes: colorize, timestamp, level, handleExceptions;
  • File logging attributes: filename, handleExceptions, exitOnError, level;
  • RollingFile logging attributes: filename, name, handleExceptions, exitOnError, level, datePattern;
  • Email logging attributes: to, from, host, port, username, password, ssl, tls, level, silent;
  • Cassandra logging attributes: level, table, partitionBy, consistency, hosts, keyspace;
  • Mongo DB logging attributes: level, silent, db, collection, safe, host, port.

About

Logging framework for Aqua.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published