将Drools记录器添加到Thorntail记录部分

时间:2019-06-21 14:21:44

标签: drools thorntail

我正在尝试配置Drools SLF4J日志记录以写入Thorntail日志记录分数,如何告诉Thorntail在org.drools级使用DEBUG

根据Drools docs,我应该将名称配置为org.drools并设置我的级别,提供了Logback和Log4J的示例,但我想知道如何使用Thorntail日志记录分数。根据{{​​3}}和Thorntail logging docs,我应该使用方括号来转义标识符,但是我不确定将其放在何处。我的规则正在按预期执行,但我也希望看到Drools调试输出。

我已经在pom中配置了Thorntail maven插件,如下所示:

<plugin>
  <groupId>io.thorntail</groupId>
  <artifactId>thorntail-maven-plugin</artifactId>
  <version>${version.thorntail}</version>
  <configuration>
    <properties>
      <!-- Network config for Docker containers -->
      <swarm.bind.address>0.0.0.0</swarm.bind.address>
      <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
      <!-- Increase logging level -->
      <thorntail.logging>FINE</thorntail.logging>
    </properties>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>package</goal>
      </goals>
    </execution>
  </executions>
</plugin>

我还添加了以下依赖项:

...
<!-- Thorntail JEE Dependencies -->
<dependency>
  <groupId>io.thorntail</groupId>
  <artifactId>jaxrs</artifactId>
</dependency>
<dependency>
  <groupId>io.thorntail</groupId>
  <artifactId>cdi</artifactId>
</dependency>
<dependency>
  <groupId>io.thorntail</groupId>
  <artifactId>logging</artifactId>
</dependency>
<!-- Drools dependencies for starting a KIE Container to process rules -->
<dependency>
  <groupId>org.kie</groupId>
  <artifactId>kie-api</artifactId>
</dependency>
<dependency>
  <groupId>org.kie</groupId>
  <artifactId>kie-ci</artifactId>
</dependency>
<!-- Add Drools core for rule processing -->
<dependency>
  <groupId>org.drools</groupId>
  <artifactId>drools-core</artifactId>
</dependency>
<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
</dependency>
...

我用以下内容创建了src/main/resources/logging.properties,尽管我得到了大量的resteasyundertow DEBUG输出,但是我没有任何Drools特定的内容输出,即使我的规则被触发了。

thorntail.logging.loggers.[org.drools].level=DEBUG

我还尝试添加src/main/resources/project-defaults.yml,其内容如下但没有运气。

thorntail:
  logging:
    loggers:
      org.drools:
        level: DEBUG

0 个答案:

没有答案