Skip to content

gshaibi/DynamicLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamically add logs to node processes. Supports cluster architecture.

Simple Usage:

var http = require('http');
var DynamicLogger = require('dynamic-logger-express');
var logger = new DynamicLogger();

var myServer = http.createServer();

logger.addLoggerAppToServer(myServer);
logger.activate();

Usage with cluster:

var DynamicLogger = require('dynamic-logger-express');
var logger = new DynamicLogger();
var masterServerPort = 10000;

if (cluster.isMaster) {
  const masterServer = http.createServer();

  dynamicLogger.addLoggerAppToServer(masterServer);
  dynamicLogger.activate();

  masterServer.listen(masterServerPort, () => console.log("Master listening on port ", masterServerPort));
} else {
  logger.listenOnWorker();
  // execute anything on the worker, and enjoy the power of dynamic logging!
}

Then, send http request to add/delete logpoints. Examples exist on './test/' You can use the package 'dynamic-logger-cli-client' to simplify these requests.

About

Dynamic logging for node processes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published