From 54db70404428bff06156a26cf1044b0fe8bc19b4 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 2 Oct 2022 23:23:26 +0200 Subject: [PATCH] Improved settings #45 --- docker-compose.yml | 29 +++++++++++++++-- src/bot/config/appsettings.development.json | 22 ++++++++++++- src/bot/config/appsettings.json | 24 ++++++++++++-- src/bot/config/appsettings.production.json | 26 +++++++++++++-- src/bot/config/appsettings.staging.json | 35 +++++++++++++++++++-- 5 files changed, 126 insertions(+), 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 07fc8d34..fde8d204 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,28 @@ version: "3.9" services: - kdb_1: + kdb_prod_1: image: kdb container_name: kdb_1 depends_on: - kdb_db_1 environment: + KDB_ENVIRONMENT: "production" KDB_TOKEN: "" KDB_PREFIX: "!k " restart: unless-stopped + kdb_staging_1: + image: kdb + container_name: kdb_1 + depends_on: + - kdb_db_1 + environment: + KDB_ENVIRONMENT: "staging" + KDB_TOKEN: "" + KDB_PREFIX: "!kt " + restart: unless-stopped + kdb_db_1: image: mysql:latest container_name: kdb_db_1 @@ -22,4 +34,17 @@ services: MYSQL_PASSWORD: "kd_kdb" MYSQL_DATABASE: "kd_kdb" ports: - - "3307:3306" \ No newline at end of file + - "3307:3306" + + kdb_db_2: + image: mysql:latest + container_name: kdb_db_2 + command: mysqld --default-authentication-plugin=mysql_native_password + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: "kd_kdb" + MYSQL_USER: "kd_kdb" + MYSQL_PASSWORD: "kd_kdb" + MYSQL_DATABASE: "kd_kdb" + ports: + - "3308:3306" \ No newline at end of file diff --git a/src/bot/config/appsettings.development.json b/src/bot/config/appsettings.development.json index 44dbc166..3278dcd7 100644 --- a/src/bot/config/appsettings.development.json +++ b/src/bot/config/appsettings.development.json @@ -7,10 +7,30 @@ }, "LoggingSettings": { "Path": "logs/", - "Filename": "log_dev.log", + "Filename": "bot.log", "ConsoleLogLevel": "DEBUG", "FileLogLevel": "DEBUG" }, + "BotLoggingSettings": { + "Command": { + "Path": "logs/", + "Filename": "commands.log", + "ConsoleLogLevel": "DEBUG", + "FileLogLevel": "DEBUG" + }, + "Database": { + "Path": "logs/", + "Filename": "database.log", + "ConsoleLogLevel": "DEBUG", + "FileLogLevel": "DEBUG" + }, + "Message": { + "Path": "logs/", + "Filename": "message.log", + "ConsoleLogLevel": "DEBUG", + "FileLogLevel": "DEBUG" + } + }, "Translation": { "DefaultLanguage": "de", "Languages": [ diff --git a/src/bot/config/appsettings.json b/src/bot/config/appsettings.json index a02074ce..643f38ab 100644 --- a/src/bot/config/appsettings.json +++ b/src/bot/config/appsettings.json @@ -6,9 +6,29 @@ "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" }, "LoggingSettings": { - "Path": "logs/", - "Filename": "log_$start_time.log", + "Path": "logs/$date_now/", + "Filename": "bot.log", "ConsoleLogLevel": "ERROR", "FileLogLevel": "WARN" + }, + "BotLoggingSettings": { + "Command": { + "Path": "logs/$date_now/", + "Filename": "commands.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "WARN" + }, + "Database": { + "Path": "logs/$date_now/", + "Filename": "database.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "WARN" + }, + "Message": { + "Path": "logs/$date_now/", + "Filename": "message.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "WARN" + } } } \ No newline at end of file diff --git a/src/bot/config/appsettings.production.json b/src/bot/config/appsettings.production.json index 515c60af..493deaba 100644 --- a/src/bot/config/appsettings.production.json +++ b/src/bot/config/appsettings.production.json @@ -6,11 +6,31 @@ "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" }, "LoggingSettings": { - "Path": "logs/", - "Filename": "log_$start_time.log", + "Path": "logs/$date_now/", + "Filename": "bot.log", "ConsoleLogLevel": "ERROR", "FileLogLevel": "INFO" }, + "BotLoggingSettings": { + "Command": { + "Path": "logs/$date_now/", + "Filename": "commands.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "INFO" + }, + "Database": { + "Path": "logs/$date_now/", + "Filename": "database.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "INFO" + }, + "Message": { + "Path": "logs/$date_now/", + "Filename": "message.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "INFO" + } + }, "Translation": { "DefaultLanguage": "de", "Languages": [ @@ -18,7 +38,7 @@ ] }, "DatabaseSettings": { - "Host": "192.168.0.40", + "Host": "localhost", "User": "kd_kdb", "Password": "a2Rfa2Ri", "Database": "kd_kdb", diff --git a/src/bot/config/appsettings.staging.json b/src/bot/config/appsettings.staging.json index 605fe7fc..ce9e6521 100644 --- a/src/bot/config/appsettings.staging.json +++ b/src/bot/config/appsettings.staging.json @@ -6,17 +6,48 @@ "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" }, "LoggingSettings": { - "Path": "logs/", - "Filename": "log_staging_$start_time.log", + "Path": "logs/$date_now/", + "Filename": "bot.log", "ConsoleLogLevel": "INFO", "FileLogLevel": "DEBUG" }, + "BotLoggingSettings": { + "Command": { + "Path": "logs/$date_now/", + "Filename": "commands.log", + "ConsoleLogLevel": "INFO", + "FileLogLevel": "DEBUG" + }, + "Database": { + "Path": "logs/$date_now/", + "Filename": "database.log", + "ConsoleLogLevel": "INFO", + "FileLogLevel": "DEBUG" + }, + "Message": { + "Path": "logs/$date_now/", + "Filename": "message.log", + "ConsoleLogLevel": "INFO", + "FileLogLevel": "DEBUG" + } + }, "Translation": { "DefaultLanguage": "de", "Languages": [ "de" ] }, + "DatabaseSettings": { + "Host": "localhost", + "User": "kd_kdb", + "Password": "a2Rfa2Ri", + "Database": "kd_kdb", + "Port": "3308", + "Charset": "utf8mb4", + "UseUnicode": "true", + "Buffered": "true", + "AuthPlugin": "mysql_native_password" + }, "FeatureFlags": { "AdminModule": true, "BaseModule": true,