private void configureContextForLogging(
            ConfigurableEnvironment env,
            String nodeId,
            NodeType nodeType) {
        ConsoleLoggingProperties consoleLoggingProperties = ConsoleLoggingProperties.builder()
                .enabled(env.getProperty(TURMS_LOGGING_CONSOLE_ENABLED,
                        Boolean.class,
                        ConsoleLoggingProperties.DEFAULT_VALUE_ENABLED))
                .level(env.getProperty(TURMS_LOGGING_CONSOLE_LEVEL,
                        LogLevel.class,
                        ConsoleLoggingProperties.DEFAULT_VALUE_LEVEL))
                .build();
        FileLoggingProperties fileLoggingProperties = FileLoggingProperties.builder()
                .enabled(env.getProperty(TURMS_LOGGING_FILE_ENABLED,
                        Boolean.class,
                        FileLoggingProperties.DEFAULT_VALUE_ENABLED))
                .level(env.getProperty(TURMS_LOGGING_FILE_LEVEL,
                        LogLevel.class,
                        FileLoggingProperties.DEFAULT_VALUE_LEVEL))
                .filePath(env.getProperty(TURMS_LOGGING_FILE_FILE_PATH,
                        String.class,
                        FileLoggingProperties.DEFAULT_VALUE_FILE_PATH))
                .maxFiles(env.getProperty(TURMS_LOGGING_FILE_MAX_FILES,
                        Integer.class,
                        FileLoggingProperties.DEFAULT_VALUE_MAX_FILES))
                .maxFileSizeMb(env.getProperty(TURMS_LOGGING_FILE_MAX_FILE_SIZE_MB,
                        Integer.class,
                        FileLoggingProperties.DEFAULT_VALUE_FILE_SIZE_MB))
                .compression(new FileLoggingCompressionProperties(
                        env.getProperty(TURMS_LOGGING_FILE_COMPRESSION_ENABLED,
                                Boolean.class,
                                FileLoggingCompressionProperties.DEFAULT_VALUE_ENABLED)))
                .build();
        LoggingProperties loggingProperties = new LoggingProperties().toBuilder()
                .console(consoleLoggingProperties)
                .file(fileLoggingProperties)
                .build();

        LoggerFactory.init(false, nodeId, nodeType, loggingProperties);
    }
@implNote We don't use {@link ApplicationContextInitializedEvent} because it is still too
          late for logging.
turms-server-common/src/main/java/im/turms/server/common/infra/application/ApplicationEnvironmentEventListener.java