Giter Club home page Giter Club logo

loopback-component-logger's People

Contributors

no9 avatar pbhadauria2000 avatar saurabh73 avatar slahiri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

loopback-component-logger's Issues

getGetCurrentContent removed from version 3

using the "enableAPI" flag to true raise this error before boot is completed,
do you think will be possible to have some indication to proceed with a PR

process.nextTick(function() { throw err; });
^

Error: loopback.getCurrentContext() was removed in version 3.0. See http://loopback.io/doc/en/lb2/Using-current-context.html for more details.
at Function.juggler.getCurrentContext.remoting.getCurrentContext.loopback.getCurrentContext [as getCurrentContext] (

Issue: Duplicate Loggers are initialized if multiple 'started' event is emitted

server/server.js has the following code app.emit('started', baseUrl); if emitted multiple times gives a duplicate Logger error.

The code in loopbackHook.js

     var enableAPI = config.enableAPI || false;
     if(enableAPI) {
         // adding log management api
         loggerModel.addModel(app);
         app.on('started', function(){
             loggerModel.attachLoggerMap(loggerMap);
         });
     }

app.on can be changed to app.once to prevent loggerModel.addMode(app) to be executed multiple times

Remove the console log from loggerModel.js in line no 56.

Need to remove the console.log from the npm package from loggerModel.js in line no 56.

console.log('Updating level for logger with name',
                        ctx.instance.name, ', New level is',ctx.instance.level);
            loggerMap[ctx.instance.name].level(ctx.instance.level);

TypeError: Logger provided is not an instance of bunyan

I tried to add loopback-component-logger to a loopback api project.

  • First I installed:
npm install --save loopback-component-logger bunyan
  • Then I added to my server.js
var bunyan = require('bunyan');
var rootLogger = bunyan.createLogger({name: 'myAPI', level: 'info'});
var logger = require('loopback-component-logger')(rootLogger);
  • Finally added this to component-config.json
,
  "loopback-component-logger": {
      "enableAPI" : true
  }

And I get the error pointed on execution

  • Versions I'm using
node v6.1.0
npm 3.7.5
loopback 2.22.0
bunyan 1.8.1
loopback-component-logger 0.3.2
  • When I comment server.js logger definition lines I get this output
WARN: Logger not initialized correctly  using defaultLogger
Updating level for logger with name perfLogger , New level is 30

I can see how defaultLogger is loaded correctly so I supose the problem must be on the Logger definition I'm using

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.