Closed shubsaini09 closed 8 years ago
First, please make sure you code is formatted and wrapped in "```" before posting questions. Unformatted code is almost impossible to read. I fixed it for you on this issue, but please keep this in mind in the future.
Second, debug
and is not an event you can filter on, and error
isn't even happening in your server. Change the arguments to good-squeeze to log: "debug"
and `log: "error" for each reporter. That should fix your issue.
Thanks for formatting my code but i did use the option insert code from the comment toolbar and placed my code inside two backticks but it didn't format my code. I don't know why i couldn't format it :/
log: "debug" and log: "error"
did fix my issue but facing a error
throw new Error(msgs.join(' ') || 'Unknown error'); Error: Unknown event type [{"type":"onPostStop"},{"type":"onPreStart"}]
That's not enough information to work on. I need the stack trace. What version of node and hapi and good are you using? Did you charge your config from your first post?
First i was using it in my practice, now when i am implementing it in my actual code, i am getting this error.
versions -
myproject $ node -v
v5.2.0
"engines": {
"node": "0.10.x"
},
"dependencies": {
"good": "^7.0.2",
"good-console": "^6.1.2",
"good-file": "^6.0.1",
"good-squeeze": "^5.0.0",
"hapi": "^8.0.0"
}
this is how i am registering
server.register([
{
register: require("good"),
options: options
},
{
other plugin
},
{
other plugin
}], (err) => {
if (err) {
return console.error(err);
}
server.start(function() {
console.log('Server started at: ' + server.info.uri);
});
});
As you can see from package.json (and you're probably getting console warnings about this too that you are ignoring) you need version 10.0.0 or greater for good version 7. Either use an older version of good or a modern version of hapi. Version 8 support ended a long time ago.
Sorry for late reply. I did update my version of hapi to recent one. The current issue seem to be fixed but i am not able to test it as my code has broken due to latest version of hapi. Fixing it might take time and i have other work which is on priority as well. I am closing this issue as of now but if any other doubt i will reopen it.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
What happens is calling both the routes logs both messages in both file, whereas i want debug message to be in debug_log and error message in error_log.