1
0
forked from mirror/misskey
This commit is contained in:
tamaina 2024-03-04 13:03:41 +00:00
parent 8e55285e48
commit 1f79cd1760
2 changed files with 15 additions and 15 deletions

View File

@ -100,7 +100,7 @@ class MyCustomLogger implements Logger {
@bindThis @bindThis
public logQuery(query: string, parameters?: any[]) { public logQuery(query: string, parameters?: any[]) {
sqlLogger.info(this.highlight(query)); sqlLogger.debug(this.highlight(query));
} }
@bindThis @bindThis

View File

@ -151,8 +151,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.systemQueueWorker this.systemQueueWorker
.on('active', (job) => systemLogger.debug(`active id=${job.id}`)) .on('active', (job) => systemLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => systemLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { e: renderError(err), data: job?.data })) .on('failed', (job, err) => systemLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { err: renderError(err), data: job?.data }))
.on('error', (err: Error) => systemLogger.error(`error`, { e: renderError(err) })) .on('error', (err: Error) => systemLogger.error(`error`, { err: renderError(err) }))
.on('stalled', (jobId) => systemLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => systemLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion
@ -190,8 +190,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.dbQueueWorker this.dbQueueWorker
.on('active', (job) => dbLogger.debug(`active id=${job.id}`)) .on('active', (job) => dbLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => dbLogger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => dbLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => dbLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { e: renderError(err), job })) .on('failed', (job, err) => dbLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { err: renderError(err), job }))
.on('error', (err: Error) => dbLogger.error('error', { e: renderError(err) })) .on('error', (err: Error) => dbLogger.error('error', { err: renderError(err) }))
.on('stalled', (jobId) => dbLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => dbLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion
@ -214,8 +214,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.deliverQueueWorker this.deliverQueueWorker
.on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) .on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) .on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => deliverLogger.warn(`failed(${err.message}) ${getJobInfo(job)} id=${job ? job.id : '-'} to=${job?.data.to}`, { e: renderError(err), data: job?.data })) .on('failed', (job, err) => deliverLogger.warn(`failed(${err.message}) ${getJobInfo(job)} id=${job ? job.id : '-'} to=${job?.data.to}`, { err: renderError(err), data: job?.data }))
.on('error', (err: Error) => deliverLogger.error('error', { e: renderError(err) })) .on('error', (err: Error) => deliverLogger.error('error', { err: renderError(err) }))
.on('stalled', (jobId) => deliverLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => deliverLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion
@ -240,9 +240,9 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('completed', (job, result) => inboxLogger.debug(`completed(${result}) ${getJobInfo(job, true)}`)) .on('completed', (job, result) => inboxLogger.debug(`completed(${result}) ${getJobInfo(job, true)}`))
.on('failed', (job, err) => inboxLogger.warn( .on('failed', (job, err) => inboxLogger.warn(
`failed(${err.message}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, `failed(${err.message}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`,
{ data: job?.data, e: renderError(err) } { data: job?.data, err: renderError(err) }
)) ))
.on('error', (err: Error) => inboxLogger.error('error', { e: renderError(err) })) .on('error', (err: Error) => inboxLogger.error('error', { err: renderError(err) }))
.on('stalled', (jobId) => inboxLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => inboxLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion
@ -265,8 +265,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.webhookDeliverQueueWorker this.webhookDeliverQueueWorker
.on('active', (job) => webhookLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) .on('active', (job) => webhookLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => webhookLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) .on('completed', (job, result) => webhookLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => webhookLogger.warn(`failed(${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`, { e: renderError(err) })) .on('failed', (job, err) => webhookLogger.warn(`failed(${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`, { err: renderError(err) }))
.on('error', (err: Error) => webhookLogger.error('error', { e: renderError(err) })) .on('error', (err: Error) => webhookLogger.error('error', { err: renderError(err) }))
.on('stalled', (jobId) => webhookLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => webhookLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion
@ -294,8 +294,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.relationshipQueueWorker this.relationshipQueueWorker
.on('active', (job) => relationshipLogger.debug(`active id=${job.id}`)) .on('active', (job) => relationshipLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => relationshipLogger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => relationshipLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => relationshipLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { e: renderError(err), job })) .on('failed', (job, err) => relationshipLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { err: renderError(err), job }))
.on('error', (err: Error) => relationshipLogger.error('error', { e: renderError(err) })) .on('error', (err: Error) => relationshipLogger.error('error', { err: renderError(err) }))
.on('stalled', (jobId) => relationshipLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => relationshipLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion
@ -317,8 +317,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.objectStorageQueueWorker this.objectStorageQueueWorker
.on('active', (job) => objectStorageLogger.debug(`active id=${job.id}`)) .on('active', (job) => objectStorageLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => objectStorageLogger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => objectStorageLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => objectStorageLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { e: renderError(err), job })) .on('failed', (job, err) => objectStorageLogger.warn(`failed(${err.message}) id=${job ? job.id : '-'}`, { err: renderError(err), job }))
.on('error', (err: Error) => objectStorageLogger.error('error', { e: renderError(err) })) .on('error', (err: Error) => objectStorageLogger.error('error', { err: renderError(err) }))
.on('stalled', (jobId) => objectStorageLogger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => objectStorageLogger.warn(`stalled id=${jobId}`));
//#endregion //#endregion