diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-07 10:40:43 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-07 10:40:43 +0100 |
commit | c0a9de6652f53328cda580a8cd11c7ee14242678 (patch) | |
tree | fbe88b7d6ef9023cf34d481995c3950668e05db1 /server | |
parent | a32bf8cd20212b903d3fa478e629f051eb77fecc (diff) | |
download | PeerTube-c0a9de6652f53328cda580a8cd11c7ee14242678.tar.gz PeerTube-c0a9de6652f53328cda580a8cd11c7ee14242678.tar.zst PeerTube-c0a9de6652f53328cda580a8cd11c7ee14242678.zip |
Prevent uploadx too big log for config
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/uploadx.ts | 13 |
1 files changed, 11 insertions, 2 deletions
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 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { buildLogger } from '@server/helpers/logger' | 2 | import { buildLogger } from '@server/helpers/logger' |
3 | import { getResumableUploadPath } from '@server/helpers/upload' | 3 | import { getResumableUploadPath } from '@server/helpers/upload' |
4 | import { Uploadx } from '@uploadx/core' | 4 | import { CONFIG } from '@server/initializers/config' |
5 | import { LogLevel, Uploadx } from '@uploadx/core' | ||
6 | |||
7 | const logger = buildLogger('uploadx') | ||
5 | 8 | ||
6 | const uploadx = new Uploadx({ | 9 | const uploadx = new Uploadx({ |
7 | directory: getResumableUploadPath(), | 10 | directory: getResumableUploadPath(), |
@@ -11,7 +14,13 @@ const uploadx = new Uploadx({ | |||
11 | // Could be big with thumbnails/previews | 14 | // Could be big with thumbnails/previews |
12 | maxMetadataSize: '10MB', | 15 | maxMetadataSize: '10MB', |
13 | 16 | ||
14 | logger: buildLogger('uploadx'), | 17 | logger: { |
18 | logLevel: CONFIG.LOG.LEVEL as LogLevel, | ||
19 | debug: logger.debug.bind(logger), | ||
20 | info: logger.info.bind(logger), | ||
21 | warn: logger.warn.bind(logger), | ||
22 | error: logger.error.bind(logger) | ||
23 | }, | ||
15 | 24 | ||
16 | userIdentifier: (_, res: express.Response) => { | 25 | userIdentifier: (_, res: express.Response) => { |
17 | if (!res.locals.oauth) return undefined | 26 | if (!res.locals.oauth) return undefined |