I am trying to debug my mobile website which is running on Nodejs.
In some part there are those lines:
var log_line = {accessCount: accessCount, x: x, time: t};
logstream.write(JSON.stringify(log_line));
Which are suppose to log parts of the users page request. The path is defined as app.get('/:x?.:y?.:z?', function(req, res){ ).
For some users this works fine, but for others in the log I only find a line saying “{"accessCount": 1, "time": "10/10/10"}“. How is it possible? shouldn’t it at least printed the x without anything beside it? what could cause this effect?
If
xisundefined, it won’t get printed: