我创建了控制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中的项目结构看起来像
我添加了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日志记录吗?
答案 0 :(得分:0)
这是我的错,我将src / test /包含在.war中,在src / test中是logback-test.xml,该文件在logback.xml之前具有优先级。我发现logback-test.xml已配置为level = -info