yantrashala / loopback-component-logger Goto Github PK
View Code? Open in Web Editor NEWLogging component for loopback with add performance instrumentation for remote methods and datasource calls
License: MIT License
Logging component for loopback with add performance instrumentation for remote methods and datasource calls
License: MIT License
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] (
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
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);
I tried to add loopback-component-logger to a loopback api project.
npm install --save loopback-component-logger bunyan
var bunyan = require('bunyan');
var rootLogger = bunyan.createLogger({name: 'myAPI', level: 'info'});
var logger = require('loopback-component-logger')(rootLogger);
,
"loopback-component-logger": {
"enableAPI" : true
}
And I get the error pointed on execution
node v6.1.0
npm 3.7.5
loopback 2.22.0
bunyan 1.8.1
loopback-component-logger 0.3.2
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.