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

Add timestamps to stdout logs #160

Open
birm opened this issue Jul 25, 2023 · 1 comment
Open

Add timestamps to stdout logs #160

birm opened this issue Jul 25, 2023 · 1 comment

Comments

@birm
Copy link
Member

birm commented Jul 25, 2023

Right now, we just see messages, e.g.

TokenExpiredError: jwt expired
    at /src/node_modules/jsonwebtoken/verify.js:190:21
    at getSecret (/src/node_modules/jsonwebtoken/verify.js:97:14)
    at module.exports [as verify] (/src/node_modules/jsonwebtoken/verify.js:101:10)
    at /src/handlers/authHandlers.js:194:11
    at Layer.handle [as handle_request] (/src/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/src/node_modules/express/lib/router/index.js:328:13)
    at /src/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/src/node_modules/express/lib/router/index.js:346:12)
    at next (/src/node_modules/express/lib/router/index.js:280:10)
    at SendStream.error (/src/node_modules/serve-static/index.js:121:7) {
  expiredAt: 2023-07-22T15:05:25.000Z
}

We should include a timestamp of the request itself!

@Negasi-Kifle
Copy link

Hello @birm could the following style be good enough:

JsonWebTokenError: jwt malformed 2024-03-27T04:40:35.824Z
JsonWebTokenError: jwt malformed
    at module.exports [as verify] (D:\Personal\outreachy\camicroscope\Caracal\node_modules\jsonwebtoken\verify.js:70:17)
    at D:\Personal\outreachy\camicroscope\Caracal\handlers\authHandlers.js:230:11
    at Layer.handle [as handle_request] (D:\Personal\outreachy\camicroscope\Caracal\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\Personal\outreachy\camicroscope\Caracal\node_modules\express\lib\router\index.js:328:13)       
    at D:\Personal\outreachy\camicroscope\Caracal\node_modules\express\lib\router\index.js:286:9
    at Function.process_params (D:\Personal\outreachy\camicroscope\Caracal\node_modules\express\lib\router\index.js:346:12)
    at next (D:\Personal\outreachy\camicroscope\Caracal\node_modules\express\lib\router\index.js:280:10)
    at SendStream.error (D:\Personal\outreachy\camicroscope\Caracal\node_modules\serve-static\index.js:121:7)
    at SendStream.emit (node:events:513:28)
    at SendStream.error (D:\Personal\outreachy\camicroscope\Caracal\node_modules\send\index.js:270:17)

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