enhance(logging): ログの情報を増やす (MisskeyIO#351)

This commit is contained in:
まっちゃとーにゅ
2024-01-11 11:41:20 +09:00
committed by GitHub
parent 38469c2b87
commit 91e4522a96
21 changed files with 100 additions and 57 deletions

View File

@@ -71,7 +71,7 @@ if (!envOption.quiet) {
// Display detail of uncaught exception
process.on('uncaughtException', err => {
try {
logger.error(err);
logger.error('Uncaught exception', { error: err });
} catch { }
});

View File

@@ -65,7 +65,7 @@ export async function masterMain() {
//await connectDb();
if (config.pidFile) fs.writeFileSync(config.pidFile, process.pid.toString());
} catch (e) {
bootLogger.error('Fatal error occurred during initialization', null, true);
bootLogger.error('Fatal error occurred during initialization', { error: e }, true);
process.exit(1);
}
@@ -124,7 +124,7 @@ function loadConfigBoot(): Config {
config = loadConfig();
} catch (exception) {
if (typeof exception === 'string') {
configLogger.error(exception);
configLogger.error(exception, null, true);
process.exit(1);
} else if ((exception as any).code === 'ENOENT') {
configLogger.error('Configuration file not found', null, true);