我创建带有控件optaplanner的RestEasy服务器。我向服务器发送了请求,然后服务器启动了optaplanner。当我像普通应用程序一样从eclipse启动optaplanner时,日志记录可以正常工作,但是当我运行服务器时,启动optaplanner时,我的日志看起来像

2017-06-08 10:35:13,033 [123] INFO  VehicleRoutingSolution TMS_DATA has 1 depots, 20 vehicles and 70 customers with a search space of 10^25.
2017-06-08 10:35:13,034 [123] INFO  Imported: \\xxxx\xxxxx\xxx\xxxx.vrp
2017-06-08 10:35:13,740 [SwingWorker-pool-8-thread-1] INFO  Solving started: time spent (394), best score (70uninitialized/-42308000hard/0soft), environment mode (REPRODUCIBLE), random (JDK with seed 0).
2017-06-08 10:35:13,916 [SwingWorker-pool-8-thread-1] INFO  Custom phase (0) ended: step total (1), time spent (570), best score (-42308000hard/0soft).
2017-06-08 10:35:16,157 [SwingWorker-pool-8-thread-1] INFO  Construction Heuristic phase (1) ended: step total (50), time spent (2811), best score (-38400hard/-2911900soft).
2017-06-08 10:35:21,673 [AWT-EventQueue-0] INFO  Terminating solver early.
2017-06-08 10:35:21,675 [SwingWorker-pool-8-thread-1] INFO  Local Search phase (2) ended: step total (8), time spent (8329), best score (-31200hard/-2911900soft).
2017-06-08 10:35:21,676 [SwingWorker-pool-8-thread-1] INFO  Solving ended: time spent (8330), best score (-31200hard/-2911900soft), average calculate count per second (1306), environment mode (REPRODUCIBLE).


我在Eclipse中的项目结构看起来像

java - 从RestEasy服务器运行Optaplanner日志记录将无法正常运行-LMLPHP java - 从RestEasy服务器运行Optaplanner日志记录将无法正常运行-LMLPHP

我添加了optaplanner来构建路径和部署程序集。

看起来像logback.xml level = -info,但它是-debug。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d [%t] %-5p %m%n</pattern>
    </encoder>
  </appender>

  <logger name="org.optaplanner" level="${logback.level.org.optaplanner:-debug}"/>

  <root level="debug">
    <appender-ref ref="consoleAppender" />
  </root>

</configuration>


我认为整个应用程序无法找到lockback.xml,但是在tomcat上提取.war之后,该文件就存在了。任何想法如何带回optaplanner日志记录?

最佳答案

那是我的错,我在.war中包含src / test /,在src / test中是logback-test.xml,并且该文件在logback.xml之前具有优先权。我发现logback-test.xml已配置为level = -info

10-08 00:21