diff --git a/pages/api/error.js b/pages/api/error-console.js similarity index 100% rename from pages/api/error.js rename to pages/api/error-console.js diff --git a/pages/api/error-pino-logflare.js b/pages/api/error-pino-logflare.js new file mode 100644 index 0000000..7316cd0 --- /dev/null +++ b/pages/api/error-pino-logflare.js @@ -0,0 +1,15 @@ +import logger from '../../logger/logger' + +export default function handler(req, res) { + + // Lets log an error with console here. + try { + throw new Error('Whoops!') + } catch (e) { + const onlyPino = require('pino')() + + onlyPino.error(e) + } + + res.status(200).json({ error: 'true' }) +} \ No newline at end of file diff --git a/pages/api/error-pino.js b/pages/api/error-pino.js new file mode 100644 index 0000000..7316cd0 --- /dev/null +++ b/pages/api/error-pino.js @@ -0,0 +1,15 @@ +import logger from '../../logger/logger' + +export default function handler(req, res) { + + // Lets log an error with console here. + try { + throw new Error('Whoops!') + } catch (e) { + const onlyPino = require('pino')() + + onlyPino.error(e) + } + + res.status(200).json({ error: 'true' }) +} \ No newline at end of file