diff --git a/src/core/render-core.js b/src/core/render-core.js index 7fc6b17b..73fa7636 100644 --- a/src/core/render-core.js +++ b/src/core/render-core.js @@ -41,9 +41,9 @@ async function getFullPageHeight(page) { async function render(_opts = {}) { const opts = _.merge({ cookies: [], - scrollPage: false, + scrollPage: true, emulateScreenMedia: true, - ignoreHttpsErrors: false, + ignoreHttpsErrors: true, html: null, viewport: { width: 1600, @@ -51,10 +51,11 @@ async function render(_opts = {}) { }, goto: { waitUntil: 'networkidle0', + timout: 120000 }, output: 'pdf', pdf: { - format: 'A4', + format: 'letter', printBackground: true, }, screenshot: { @@ -230,7 +231,7 @@ async function scrollPage(page) { setTimeout(scrollDown, scrollInterval); } - setTimeout(reject, 30000); + setTimeout(reject, 120000); scrollDown(); }); }); @@ -242,6 +243,10 @@ function logOpts(opts) { supressedOpts.html = '...'; } + if (opts.url && opts.url.length > 1024) { + supressedOpts.url = opts.url.slice(0, 300); + } + logger.info(`Rendering with opts: ${JSON.stringify(supressedOpts, null, 2)}`); } diff --git a/src/middleware/error-logger.js b/src/middleware/error-logger.js index dd583c1f..03f7f72c 100644 --- a/src/middleware/error-logger.js +++ b/src/middleware/error-logger.js @@ -35,7 +35,7 @@ function getLogLevel(status) { function logRequestDetails(logLevel, req) { logger[logLevel]('Request headers:', deepSupressLongStrings(req.headers)); logger[logLevel]('Request parameters:', deepSupressLongStrings(req.params)); - logger[logLevel]('Request body:', req.body); + logger[logLevel]('Request body:', deepSupressLongStrings(req.body)); } function deepSupressLongStrings(obj) {