From 5509d9eec9c1dd47330f22be1e588ac756785c35 Mon Sep 17 00:00:00 2001
From: Andrew Farries <andrew@gitpod.io>
Date: Fri, 29 Apr 2022 12:23:32 +0000
Subject: [PATCH] Remove logLevel from server config

Where we need it, take it from the environment.
---
 components/server/ee/src/prebuilds/github-app.ts | 4 +++-
 components/server/src/config.ts                  | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/components/server/ee/src/prebuilds/github-app.ts b/components/server/ee/src/prebuilds/github-app.ts
index f41b33a45a83a8..879c212f0da799 100644
--- a/components/server/ee/src/prebuilds/github-app.ts
+++ b/components/server/ee/src/prebuilds/github-app.ts
@@ -67,12 +67,14 @@ export class GithubApp {
         @inject(PrebuildStatusMaintainer) protected readonly statusMaintainer: PrebuildStatusMaintainer,
     ) {
         if (config.githubApp?.enabled) {
+            const logLevel = LogrusLogLevel.getFromEnv() ?? "info";
+
             this.server = new Server({
                 Probot: Probot.defaults({
                     appId: config.githubApp.appId,
                     privateKey: GithubApp.loadPrivateKey(config.githubApp.certPath),
                     secret: config.githubApp.webhookSecret,
-                    logLevel: GithubApp.mapToGitHubLogLevel(config.logLevel),
+                    logLevel: GithubApp.mapToGitHubLogLevel(logLevel),
                     baseUrl: config.githubApp.baseUrl,
                 }),
             });
diff --git a/components/server/src/config.ts b/components/server/src/config.ts
index 7b4b23f2db53e8..d936304276f3b9 100644
--- a/components/server/src/config.ts
+++ b/components/server/src/config.ts
@@ -14,7 +14,7 @@ import { CodeSyncConfig } from "./code-sync/code-sync-service";
 import { ChargebeeProviderOptions, readOptionsFromFile } from "@gitpod/gitpod-payment-endpoint/lib/chargebee";
 import * as fs from "fs";
 import * as yaml from "js-yaml";
-import { log, LogrusLogLevel } from "@gitpod/gitpod-protocol/lib/util/logging";
+import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
 import { filePathTelepresenceAware } from "@gitpod/gitpod-protocol/lib/env";
 
 export const Config = Symbol("Config");
@@ -52,7 +52,6 @@ export interface ConfigSerialized {
     installationShortname: string;
     devBranch?: string;
     insecureNoDomain: boolean;
-    logLevel: LogrusLogLevel;
 
     // Use one or other - licenseFile reads from a file and populates license
     license?: string;