停止服务时无法在Spring Boot控制台上获取应用程序日志

问题描述

我要在春季靴子休息时接触柑橘黄瓜。在日食中运行时一切都很好。因此,通过使用“ mvn clean install”命令,我提取一个jar文件,并在从浏览器中访问其余服务后,使用此命令执行jar“ java -jar ”,然后在春季没有找到任何与柑橘黄瓜相关的日志文件启动控制台。这是我在eclipse中运行的spring应用程序。

public class FeatureController {


@RequestMapping(value="/MQEndtoEnd",produces = MediaType.TEXT_HTML_VALUE)
public String executeFeature(@RequestParam(name = "FeatureFileName") String featureFileName) throws 
    Throwable  {
    String content="";
    String path="D:\\citrus\\Report_Directory\\citrus-test- 
           results.html";//inputs/Report_Directory/citrus-test-results.html
     


    **/*running junit inside rest controller*/ 
    Class jtest=TodoFeatureTest.class;
    JUnitCore.runclasses(jtest);**  
 
    try {

         /*reading html content and returning to bowser*/

        content = FileUtils.readFiletoString(new File(path),StandardCharsets.UTF_8); 
   
    } catch (IOException e) {
        e.printstacktrace();
    }
            return content;
    }   
  }

}

这是控制器类。使用junit运行黄瓜类并返回html报告文件作为字符串内容

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features={"D:/citrus_works/citrus"},//inputs
strict = true,glue = { "D:/citrus_works/citrus" },//inputs
        plugin = { "com.consol.citrus.cucumber.CitrusReporter" } )

public class TodoFeatureTest  {
    
}
   

控制器类运行此junit类

    logging.level.org.springframework=DEBUG
logging.level.com.howtodoinjava=DEBUG
 
#output to a temp_folder/file
logging.file=${java.io.tmpdir}/application.log
 
# Logging pattern for the console
logging.pattern.console= %d{yyyy-MM-dd HH:mm:ss} - %msg%n
 
# Logging pattern for file
logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%
enter code here

这是spring应用程序属性文件

{{1}}

当我在eclipse中运行spring boot应用程序时能够看到与柑橘相关的日志,但是当我在命令提示符下执行可执行的java jar文件并从浏览器中命中该服务时,无法在命令提示符下看到与柑橘相关的日志。我需要解决这个问题。这是放置在Eclipse

enter image description here

中的控制台。人们可以在Eclipse控制台上查看与柑橘,黄瓜相关的日志。这些日志在命令提示符下丢失。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...