chore(server): change the log level (#4106)
This commit is contained in:
@@ -27,7 +27,7 @@ import { Config } from './config';
|
|||||||
import { serverTimingAndCache } from './middleware/timing';
|
import { serverTimingAndCache } from './middleware/timing';
|
||||||
import { RedisIoAdapter } from './modules/sync/redis-adapter';
|
import { RedisIoAdapter } from './modules/sync/redis-adapter';
|
||||||
|
|
||||||
const { NODE_ENV } = process.env;
|
const { NODE_ENV, AFFINE_ENV } = process.env;
|
||||||
|
|
||||||
if (NODE_ENV === 'production') {
|
if (NODE_ENV === 'production') {
|
||||||
const traceExporter = new TraceExporter();
|
const traceExporter = new TraceExporter();
|
||||||
@@ -60,7 +60,10 @@ if (NODE_ENV === 'production') {
|
|||||||
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
|
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
|
||||||
cors: true,
|
cors: true,
|
||||||
bodyParser: true,
|
bodyParser: true,
|
||||||
logger: NODE_ENV === 'production' ? ['log'] : ['verbose'],
|
logger:
|
||||||
|
NODE_ENV !== 'production' || AFFINE_ENV !== 'production'
|
||||||
|
? ['verbose']
|
||||||
|
: ['log'],
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(serverTimingAndCache);
|
app.use(serverTimingAndCache);
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ export class NextAuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (redirect?.endsWith('api/auth/error?error=AccessDenied')) {
|
if (redirect?.endsWith('api/auth/error?error=AccessDenied')) {
|
||||||
|
this.logger.debug(req.headers);
|
||||||
if (!req.headers?.referer) {
|
if (!req.headers?.referer) {
|
||||||
res.redirect('https://community.affine.pro/c/insider-general/');
|
res.redirect('https://community.affine.pro/c/insider-general/');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user