gpt4 book ai didi

java - RestExpress - 无法看到 Infinispan 日志

转载 作者:行者123 更新时间:2023-12-02 03:51:29 26 4
gpt4 key购买 nike

我正在使用嵌入 RestExpress 0.10.4 中的 Infinispan 7.2.5。我已在 3 个虚拟机中部署了 RestExpress 应用程序。但我看不到任何 infinispan 相关日志(org.infinispan、org.jboss、org.jgroups)。

2016-03-07 01:00:42 DEBUG logging:15 - Logging Provider: infinispan.org.jboss.logging.Log4jLoggerProvider
2016-03-07 01:00:42 DEBUG ServiceFinder:61 - Loading service impl: JpaStoreLifecycleManager
2016-03-07 01:00:42 DEBUG ServiceFinder:52 - No service impls found: ModuleMetadataFileFinder
2016-03-07 01:00:42 DEBUG ServiceFinder:52 - No service impls found: ModuleCommandExtensions
2016-03-07 01:00:42 DEBUG ModuleProperties:80 - No module command extensions to load
2016-03-07 01:00:42 DEBUG DefaultCacheManager:631 - Started cache manager test-cluster on null

当我在 3 个虚拟机中设置 Infinispan 时,它运行良好。

01:10:55,376 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
01:10:55,741 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
01:10:55,884 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: JBoss Infinispan Server 7.2.5.Final (WildFly 8.2.0.Final) starting
...........

我的缓存配置如下。

GlobalConfigurationBuilder global = GlobalConfigurationBuilder.defaultClusteredBuilder();
global.transport().clusterName("test-cluster");

ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.DIST_SYNC);

// Initialize the cache manager
DefaultCacheManager cacheManager = new DefaultCacheManager(global.build(), builder.build());

我的log4j配置如下。

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>

<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - $
</layout>
</appender>

<appender name="file" class="org.apache.log4j.RollingFileAppender">
<param name="append" value="false" />
<param name="maxFileSize" value="10MB" />
<param name="maxBackupIndex" value="10" />
<param name="file" value="/var/log/caceh-restservice-test.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - $
</layout>
</appender>

<logger name="com">
<level value="INFO" />
</logger>

<logger name="org">
<level value="INFO" />
</logger>

<logger name="org.infinispan">
<level value="DEBUG"/>
</logger>

<logger name="org.jboss">
<level value="DEBUG"/>
</logger>

<logger name="com.xxxxx.test.infinispandistributed">
<level value="DEBUG" />
</logger>
<root>
<level value="DEBUG" />
<appender-ref ref="console" />
<!-- appender-ref ref="file" /-->
</root>
</log4j:configuration>

任何帮助将不胜感激。

最佳答案

我会回答我自己的问题。

节点似乎注意到加入集群,或者可能在收到第一个请求之前不会启动缓存。

一旦我将值放入缓存,日志就会按预期生成。

2016-03-07 23:53:53 INFO  JGroupsTransport:186 - ISPN000078: Starting JGroups channel test-cluster
2016-03-07 23:53:53 WARN UDP:536 - JGRP000015: the send buffer of socket DatagramSocket was set to 1MB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max send buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
2016-03-07 23:53:53 WARN UDP:548 - JGRP000015: the receive buffer of socket DatagramSocket was set to 20MB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)

关于java - RestExpress - 无法看到 Infinispan 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35839107/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com