@Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
        Class<?> mainApplicationClass = event.getSpringApplication()
                .getMainApplicationClass();
        ConfigurableEnvironment env = event.getEnvironment();
        // Though it is more reasonable to init the node ID and ID in
        // "im.turms.server.common.infra.cluster.node.Node",
        // we need to ensure the local node info is logged
        // even if the local node hasn't been inited.
        // So we initialize the node info here.
        String nodeId = Node.initNodeId(env.getProperty(TURMS_CLUSTER_NODE_ID, String.class));
        NodeType nodeType = findNodeType(event, mainApplicationClass);
        Node.nodeType = nodeType;
        configureContextForLogging(env, nodeId, nodeType);
    }
@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