csquared/node-logfmt

time is not logged with an "error" log

jonathaningram opened this issue · 5 comments

Would you consider adding time to the object logged for errors?

Currently logfmt will print out an error looking like this. As you can see there's no indication of when this happened unless one puts the time in the err's message string.

error=true id=4424516491 message="ahh well..."
error=true id=4424516491 line=0 trace="Error: ahh well..."
error=true id=4424516491 line=1 trace="    at Server.<anonymous> (/theproject/src/routes.js:13:14)"
error=true id=4424516491 line=2 trace="    at next (/theproject/node_modules/restify/lib/server.js:731:30)"
error=true id=4424516491 line=3 trace="    at f (/theproject/node_modules/restify/node_modules/once/once.js:16:25)"
error=true id=4424516491 line=4 trace="    at Server.check (/theproject/node_modules/authware/src/middleware.js:82:7)"
error=true id=4424516491 line=5 trace="    at next (/theproject/node_modules/restify/lib/server.js:731:30)"
error=true id=4424516491 line=6 trace="    at f (/theproject/node_modules/restify/node_modules/once/once.js:16:25)"
error=true id=4424516491 line=7 trace="    at Server.parseQueryString (/theproject/node_modules/restify/lib/plugins/query.js:39:17)"
error=true id=4424516491 line=8 trace="    at next (/theproject/node_modules/restify/lib/server.js:731:30)"
error=true id=4424516491 line=9 trace="    at f (/theproject/node_modules/restify/node_modules/once/once.js:16:25)"

great suggestion -- i'll get that in there

awesome thanks!

Sorry this took forever!! Just pushed v1.2.0 w. time logged on errors. :)

thanks @csquared much appreciated!