diff options
Diffstat (limited to 'server/lib/uploadx.ts')
-rw-r--r-- | server/lib/uploadx.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts index 9484eff75..58040cb6d 100644 --- a/server/lib/uploadx.ts +++ b/server/lib/uploadx.ts | |||
@@ -1,6 +1,10 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { buildLogger } from '@server/helpers/logger' | ||
2 | import { getResumableUploadPath } from '@server/helpers/upload' | 3 | import { getResumableUploadPath } from '@server/helpers/upload' |
3 | 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') | ||
4 | 8 | ||
5 | const uploadx = new Uploadx({ | 9 | const uploadx = new Uploadx({ |
6 | directory: getResumableUploadPath(), | 10 | directory: getResumableUploadPath(), |
@@ -10,6 +14,14 @@ const uploadx = new Uploadx({ | |||
10 | // Could be big with thumbnails/previews | 14 | // Could be big with thumbnails/previews |
11 | maxMetadataSize: '10MB', | 15 | maxMetadataSize: '10MB', |
12 | 16 | ||
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 | }, | ||
24 | |||
13 | userIdentifier: (_, res: express.Response) => { | 25 | userIdentifier: (_, res: express.Response) => { |
14 | if (!res.locals.oauth) return undefined | 26 | if (!res.locals.oauth) return undefined |
15 | 27 | ||