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:
parent
73568ba55a
commit
41c9db30b5
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue