Added the parameter logQueries to enable or disable queries log
Handle queries in middleware and save them in res.locals.sql
Using the previous middleware in query, job, and copy controllers endpoints
Generic log middleware (using headers system X-SQLAPI-Log). Now it is only used for queries log, but it could be the solution to change string log to JSON log
Using log middleware only in query and job controllers endpoints. Copy endpoints use their log
extracting stringifyForLogs function and refactor to avoid modifying the original
Solves https://github.com/CartoDB/CartoDB-SQL-API/issues/573
Tasks:
logQueries
to enable or disable queries logres.locals.sql
X-SQLAPI-Log
). Now it is only used for queries log, but it could be the solution to changestring
log toJSON
logstringifyForLogs
function and refactor to avoid modifying the original