Skip to content

Commit ac156ef

Browse files
committed
Fix log level management
1 parent 97eae26 commit ac156ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ import { NestFactory } from "@nestjs/core";
55
import { RandomExampleProviderModule } from "./app.module";
66
import { DocumentBuilder, SwaggerDocumentOptions, SwaggerModule } from "@nestjs/swagger";
77
import helmet from "helmet";
8+
import { LogLevel } from "@nestjs/common";
89

910
async function bootstrap() {
10-
const app = await NestFactory.create(RandomExampleProviderModule);
11+
let logLevels: LogLevel[] = ["log"];
12+
if (process.env.LOG_LEVEL == "debug") {
13+
logLevels = ["verbose"];
14+
}
15+
16+
const app = await NestFactory.create(RandomExampleProviderModule, { logger: logLevels });
1117
app.use(helmet());
1218
const basePath = process.env.VALUE_PROVIDER_CLIENT_BASE_PATH ?? "";
1319

0 commit comments

Comments
 (0)