Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log entries under "log" without being in any "level" #4

Open
robross0606 opened this issue Apr 21, 2020 · 4 comments
Open

Log entries under "log" without being in any "level" #4

robross0606 opened this issue Apr 21, 2020 · 4 comments

Comments

@robross0606
Copy link

After using the API to capture logging output, I'm finding instances of data appearing under log but everything under levels is blank.

@robross0606
Copy link
Author

Here is an example partial result from getLog():

{
  "log": " [\u001b[31merror\u001b[39m]: Failed to start web server: listen EADDRINUSE: address already in use :::50544  metadata: {\n  \"stack\": [\n    \"startServer (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:116:11)\",\n    \"processTicksAndRejections (internal/process/task_queues.js:94:5)\",\n    \"Object.koaApp (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:135:24)\",\n    \"Object.<anonymous> (C:\\\\Code\\\\ncp\\\\study-design-service\\\\src\\\\__tests__\\\\index.test.js:68:27)\",\n    \"Server.setupListenHandle [as _listen2] (net.js:1306:16)\",\n    \"listenInCluster (net.js:1354:12)\",\n    \"Server.listen (net.js:1442:7)\",\n    \"Application.listen (C:\\\\Code\\\\ncp\\\\study-design-service\\\\node_modules\\\\koa\\\\lib\\\\application.js:80:19)\",\n    \"startServer (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:108:32)\",\n    \"Object.koaApp (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:135:30)\",\n    \"processTicksAndRejections (internal/process/task_queues.js:94:5)\",\n    \"Object.<anonymous> (C:\\\\Code\\\\ncp\\\\study-design-service\\\\src\\\\__tests__\\\\index.test.js:68:27)\",\n    \"Caused by: listen EADDRINUSE: address already in use :::50544\",\n    \"Server.setupListenHandle [as _listen2] (net.js:1306:16)\",\n    \"listenInCluster (net.js:1354:12)\",\n    \"Server.listen (net.js:1442:7)\",\n    \"Application.listen (C:\\\\Code\\\\ncp\\\\study-design-service\\\\node_modules\\\\koa\\\\lib\\\\application.js:80:19)\",\n    \"startServer (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:108:32)\",\n    \"Object.koaApp (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:135:30)\",\n    \"processTicksAndRejections (internal/process/task_queues.js:94:5)\",\n    \"Object.<anonymous> (C:\\\\Code\\\\ncp\\\\study-design-service\\\\src\\\\__tests__\\\\index.test.js:68:27)\"\n  ],\n  \"ncpLogClient\": \"study-design-service\"\n}\r",
  "logs": [
    [
      null,
      " [\u001b[31merror\u001b[39m]: Failed to start web server: listen EADDRINUSE: address already in use :::50544  metadata: {\n  \"stack\": [\n    \"startServer (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:116:11)\",\n    \"processTicksAndRejections (internal/process/task_queues.js:94:5)\",\n    \"Object.koaApp (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:135:24)\",\n    \"Object.<anonymous> (C:\\\\Code\\\\ncp\\\\study-design-service\\\\src\\\\__tests__\\\\index.test.js:68:27)\",\n    \"Server.setupListenHandle [as _listen2] (net.js:1306:16)\",\n    \"listenInCluster (net.js:1354:12)\",\n    \"Server.listen (net.js:1442:7)\",\n    \"Application.listen (C:\\\\Code\\\\ncp\\\\study-design-service\\\\node_modules\\\\koa\\\\lib\\\\application.js:80:19)\",\n    \"startServer (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:108:32)\",\n    \"Object.koaApp (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:135:30)\",\n    \"processTicksAndRejections (internal/process/task_queues.js:94:5)\",\n    \"Object.<anonymous> (C:\\\\Code\\\\ncp\\\\study-design-service\\\\src\\\\__tests__\\\\index.test.js:68:27)\",\n    \"Caused by: listen EADDRINUSE: address already in use :::50544\",\n    \"Server.setupListenHandle [as _listen2] (net.js:1306:16)\",\n    \"listenInCluster (net.js:1354:12)\",\n    \"Server.listen (net.js:1442:7)\",\n    \"Application.listen (C:\\\\Code\\\\ncp\\\\study-design-service\\\\node_modules\\\\koa\\\\lib\\\\application.js:80:19)\",\n    \"startServer (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:108:32)\",\n    \"Object.koaApp (C:\\\\Code\\\\ncp\\\\study-design-service\\\\index.js:135:30)\",\n    \"processTicksAndRejections (internal/process/task_queues.js:94:5)\",\n    \"Object.<anonymous> (C:\\\\Code\\\\ncp\\\\study-design-service\\\\src\\\\__tests__\\\\index.test.js:68:27)\"\n  ],\n  \"ncpLogClient\": \"study-design-service\"\n}\r"
    ]
  ],
  "levels": {
    "log": "",
    "info": "",
    "warn": "",
    "error": ""
  },
}

Note that log has data and logs has a value listed with a category of null.

@kevin940726
Copy link
Owner

Thanks for the issue! Do you have reproducible steps or test cases?

@robross0606
Copy link
Author

robross0606 commented Apr 22, 2020

I have test cases that can reproduce this, but as part of a much larger code base. Would need to extract into something else. It appears to be related to winston logging. Either way I would think a level of "null" should end up in "log" level instead of being ignored by the levels section.

@kevin940726
Copy link
Owner

kevin940726 commented Apr 23, 2020

I don't see why there would be a level of null though 🤔? Please try to provide a minimal reproducible test case so that I can help debugging it, thx ☺️ !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants