diff --git a/octobot/cli.py b/octobot/cli.py index 7062a667a..83ea92c4e 100644 --- a/octobot/cli.py +++ b/octobot/cli.py @@ -196,7 +196,7 @@ async def _get_authenticated_community_if_possible(config, logger): constants.USER_ACCOUNT_EMAIL, None, auth_key=constants.USER_AUTH_KEY ) except authentication.AuthenticationError as err: - logger.debug(f"Auth key auth failure ({err}). Trying other methods if available.") + logger.info(f"Auth key auth failure ({err}). Trying other methods if available.") if constants.USER_ACCOUNT_EMAIL and constants.USER_PASSWORD_TOKEN: try: logger.debug("Attempting password token authentication") @@ -204,7 +204,7 @@ async def _get_authenticated_community_if_possible(config, logger): constants.USER_ACCOUNT_EMAIL, None, password_token=constants.USER_PASSWORD_TOKEN ) except authentication.AuthenticationError as err: - logger.debug(f"Password token auth failure ({err}). Trying with saved session.") + logger.info(f"Password token auth failure ({err}). Trying with saved session.") if not community_auth.is_initialized(): # try with saved credentials if any has_tentacles = tentacles_manager_api.is_tentacles_architecture_valid() diff --git a/octobot/constants.py b/octobot/constants.py index f240d6188..47d0350eb 100644 --- a/octobot/constants.py +++ b/octobot/constants.py @@ -163,6 +163,7 @@ # logs LOGS_FOLDER = "logs" +FORCED_LOG_LEVEL = os.getenv("FORCED_LOG_LEVEL", "") ENV_TRADING_ENABLE_DEBUG_LOGS = os_util.parse_boolean_environment_var("ENV_TRADING_ENABLE_DEBUG_LOGS", "False") # system diff --git a/octobot/logger.py b/octobot/logger.py index 39f700cfa..22e0b76cd 100644 --- a/octobot/logger.py +++ b/octobot/logger.py @@ -14,10 +14,10 @@ # You should have received a copy of the GNU General Public # License along with OctoBot. If not, see . import logging +import logging.config as config import os import shutil import traceback -import logging.config as config import sys import async_channel.channels as channel_instances @@ -91,6 +91,11 @@ def _load_logger_config(): os.mkdir(commons_constants.USER_FOLDER) shutil.copyfile(constants.LOGGING_CONFIG_FILE, configuration_manager.get_user_local_config_file()) config.fileConfig(configuration_manager.get_user_local_config_file()) + if constants.FORCED_LOG_LEVEL: + logging.getLogger("Logging Configuration").info( + f"Applying forced logging level {constants.FORCED_LOG_LEVEL}" + ) + common_logging.set_global_logger_level(constants.FORCED_LOG_LEVEL) except Exception as ex: config.fileConfig(constants.LOGGING_CONFIG_FILE) logging.getLogger("Logging Configuration").warning(f"Impossible to initialize local logging configuration file,"