简体   繁体   English

当我将我的 java 应用程序作为服务运行时,日志文件没有更新

[英]Log file not updating when I run my java app as a service

I am not good in Ubuntu and I have the problem.我不擅长 Ubuntu,我有问题。 I have my Java+Spring app which works perfect and it writes log file in the app directory when I run it as:我有我的 Java+Spring 应用程序,它运行完美,当我运行它时它会在应用程序目录中写入日志文件:

sudo java -jar MyApp.jar &

But I want to run it as a service so I searched the web and did everything like here .但我想将它作为一项服务运行,所以我在网上搜索并做了所有类似这里的事情。 The app works fine, but the log file has no update any more.该应用程序运行良好,但日志文件不再更新。

You need to provide more info on HOW you are running your program "as a service" and HOW you're creating/opening your log file in your program.您需要提供有关如何“作为服务”运行程序以及如何在程序中创建/打开日志文件的更多信息。 If you're creating the log file in the current working folder then probably your start script is starting your program in some other folder you're not looking for or do not have permission to write.如果您在当前工作文件夹中创建日志文件,那么您的启动脚本可能正在您不寻找或没有写入权限的其他文件夹中启动程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我运行可运行的jar时未创建日志文件 - Log file is not created when i run my runnable jar 每次使用 Log4j 运行 Java 程序时,如何重新创建日志文件? - How to create log file freshly every time I run my Java Program using Log4j? 使用外部服务或代理记录所有文件访问和处理完成我的 Java 网络应用程序? - Using an external service or agent to Log all the file accesses and processing done my Java web-app? 我想将数据记录到运行.jar文件时在Java控制台上显示的文件中 - I want to log data in a file which is displayed on java console when I run .jar file 当我尝试运行我的应用程序时无法编译值文件 - Failed to compile values file' when i try to run my app 当我在jar文件上运行时,我的应用程序中未显示Unicode - Unicode not shown in my app when i run on jar file 如何使用WAR文件将Java应用程序部署到Azure云服务(不是VM或App Service)? - How do I deploy my Java Application to Azure Cloud Service(not VM or App Service) using a WAR file? 它在我运行应用程序时重启我的应用程序 - it restart my app when I run the app 如何从主Java应用程序运行jar文件? jar文件必须在我的Java项目中 - How can I run a jar file from my main Java app? Where jar file must be in my Java project 我得到了这个异常java.sql.SQLException:404 OK我在本地运行我的appengine应用程序 - i got this exception java.sql.SQLException: 404 OK when i run my appengine app on local
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM