简体   繁体   English

禁用 Infinispan WARN 日志

[英]Disable Infinispan WARN logs

i am using infispan in distributed mode which works fine, the only problem is, it prints a lot of logs and messes up the log files.我在分布式模式下使用 infispan 工作正常,唯一的问题是,它打印了很多日志并弄乱了日志文件。 below is a common line that gets printed.下面是打印的常见行。

WARN [jgroups-6,batch-pdcr-app-6c8fcd799c-fhmf8-35894] UDP: JGRP000012: discarded message from different cluster recon-infinispan (our cluster is ISPN). Sender was 021f21a7-4434-0509-f6bb-b3451f0c98d5 (received 33 identical messages from 021f21a7-4434-0509-f6bb-b3451f0c98d5 in the last 60012 ms)

how do i disable this logging?如何禁用此日志记录?

below is the cache configuration.下面是缓存配置。

         @Bean
         @Primary
            public EmbeddedCacheManager cacheManager() {
                return new DefaultCacheManager(getGlobalConfiguration());
            }
        
            private GlobalConfiguration getGlobalConfiguration() {
                GlobalConfigurationBuilder globalConfigurationBuilder = new GlobalConfigurationBuilder();
                globalConfigurationBuilder.transport().defaultTransport().initialClusterSize(1);
                return globalConfigurationBuilder.build();
            }
    
    
     @Bean
        public Cache<String, String> interfaceCache(DefaultCacheManager cacheManager) {
            return this.buildCache(ProducerConstants.BATCH_PRODUCER_INTERFACE_CACHE, cacheManager, interfaceCacheExpiringEvictingConfig(cacheManager));
        }
    
        private Configuration interfaceCacheExpiringEvictingConfig(DefaultCacheManager cacheManager) {
    
    
            ConfigurationBuilder confBuilder = new ConfigurationBuilder();
            confBuilder.expiration().lifespan(24, TimeUnit.HOURS);
            confBuilder.memory().maxCount(100).whenFull(EvictionStrategy.REMOVE);
            confBuilder.clustering().cacheMode(CacheMode.DIST_SYNC);
    
            return confBuilder.build();
        }

private <K, V> Cache<K, V> buildCache(String cacheName, DefaultCacheManager cacheManager, Configuration configuration) {

        cacheManager.defineConfiguration(cacheName, configuration);
        Cache<K, V> cache = cacheManager.getCache(cacheName);
        cache.addListener(new CacheListener());
        return cache;
    }

You have 2 clusters using the same ports and the traffic conflicts with each other.您有 2 个使用相同端口的集群,并且流量相互冲突。 I would recommend using different ports in one of the clusters.我建议在其中一个集群中使用不同的端口。 The properties jgroups.bind.port and jgroups.mcast_port can be used to configure the JGroups ports.属性jgroups.bind.portjgroups.mcast_port可用于配置 JGroups 端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM