[英]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.