From c0a9de6652f53328cda580a8cd11c7ee14242678 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 7 Nov 2022 10:40:43 +0100 Subject: Prevent uploadx too big log for config --- server/lib/uploadx.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts index cdbe7e473..58040cb6d 100644 --- a/server/lib/uploadx.ts +++ b/server/lib/uploadx.ts @@ -1,7 +1,10 @@ import express from 'express' import { buildLogger } from '@server/helpers/logger' import { getResumableUploadPath } from '@server/helpers/upload' -import { Uploadx } from '@uploadx/core' +import { CONFIG } from '@server/initializers/config' +import { LogLevel, Uploadx } from '@uploadx/core' + +const logger = buildLogger('uploadx') const uploadx = new Uploadx({ directory: getResumableUploadPath(), @@ -11,7 +14,13 @@ const uploadx = new Uploadx({ // Could be big with thumbnails/previews maxMetadataSize: '10MB', - logger: buildLogger('uploadx'), + logger: { + logLevel: CONFIG.LOG.LEVEL as LogLevel, + debug: logger.debug.bind(logger), + info: logger.info.bind(logger), + warn: logger.warn.bind(logger), + error: logger.error.bind(logger) + }, userIdentifier: (_, res: express.Response) => { if (!res.locals.oauth) return undefined -- cgit v1.2.3