0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Debug: MySQL logging hook

no issue
This commit is contained in:
kirrg001 2017-10-04 10:40:59 +02:00 committed by Kevin Ansfield
parent 73568ba55a
commit 41c9db30b5

View file

@ -1,5 +1,7 @@
var knex = require('knex'),
config = require('../../config'),
logging = require('../../logging'),
errors = require('../../errors'),
knexInstance;
// @TODO:
@ -16,6 +18,13 @@ function configure(dbConfig) {
if (client === 'mysql') {
dbConfig.connection.timezone = 'UTC';
dbConfig.connection.charset = 'utf8mb4';
dbConfig.connection.loggingHook = function loggingHook(err) {
logging.error(new errors.InternalServerError({
code: 'MYSQL_LOGGING_HOOK',
err: err
}));
};
}
return dbConfig;