Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/core/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
loggers: {},
init(uid) {
const loggerFormats = [
winston.format.errors({ stack: true }),
winston.format.label({ label: uid }),
winston.format.timestamp()
]
Expand All @@ -15,7 +16,7 @@ module.exports = {
loggerFormats.push(winston.format.json())
} else {
loggerFormats.push(winston.format.colorize())
loggerFormats.push(winston.format.printf(info => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`))
loggerFormats.push(winston.format.printf(info => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}${info.stack ? '\n' + info.stack : ''}`))
}

const logger = winston.createLogger({
Expand Down
2 changes: 1 addition & 1 deletion server/jobs/fetch-graph-locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ module.exports = async (localeCode) => {
WIKI.logger.info(`Fetching locale ${localeCode} from Graph endpoint: [ COMPLETED ]`)
} catch (err) {
WIKI.logger.error(`Fetching locale ${localeCode} from Graph endpoint: [ FAILED ]`)
WIKI.logger.error(err.message)
WIKI.logger.error(err)
}
}
2 changes: 1 addition & 1 deletion server/jobs/purge-uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ module.exports = async () => {
WIKI.logger.info('Purging orphaned upload files: [ COMPLETED ]')
} catch (err) {
WIKI.logger.error('Purging orphaned upload files: [ FAILED ]')
WIKI.logger.error(err.message)
WIKI.logger.error(err)
}
}
2 changes: 1 addition & 1 deletion server/jobs/rebuild-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = async (pageId) => {
WIKI.logger.info(`Rebuilding page tree: [ COMPLETED ]`)
} catch (err) {
WIKI.logger.error(`Rebuilding page tree: [ FAILED ]`)
WIKI.logger.error(err.message)
WIKI.logger.error(err)
// exit process with error code
throw err
}
Expand Down
2 changes: 1 addition & 1 deletion server/jobs/render-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = async (pageId) => {
WIKI.logger.info(`Rendering page ID ${pageId}: [ COMPLETED ]`)
} catch (err) {
WIKI.logger.error(`Rendering page ID ${pageId}: [ FAILED ]`)
WIKI.logger.error(err.message)
WIKI.logger.error(err)
// exit process with error code
throw err
}
Expand Down
2 changes: 1 addition & 1 deletion server/jobs/sanitize-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = async (svgPath) => {
WIKI.logger.info(`Sanitized SVG file upload: [ COMPLETED ]`)
} catch (err) {
WIKI.logger.error(`Failed to sanitize SVG file upload: [ FAILED ]`)
WIKI.logger.error(err.message)
WIKI.logger.error(err)
throw err
}
}