当安装速度我得到这个错误(张贴只是“造成” – 消息):
java.lang.RuntimeException: VeLocity Could not be initialized! Caused by: org.apache.veLocity.exception.VeLocityException: Error initializing log: Failed to initialize an instance of org.apache.veLocity.runtime.log.Log4JLogChute with the current runtime configuration. Caused by: org.apache.veLocity.exception.VeLocityException: Failed to initialize an instance of org.apache.veLocity.runtime.log.Log4JLogChute with the current runtime configuration. Caused by: java.lang.RuntimeException: Error configuring Log4JLogChute : Caused by: java.io.FileNotFoundException: veLocity.log (Permission denied)
这是我的代码片段:
VeLocityEngine ve = new VeLocityEngine(); ve.evaluate(context,writer,"org.apache.veLocity.runtime.log.NullLogChute",this.templateString);
起初我的代码如下所示:
runtimeServices = RuntimeSingleton.getRuntimeServices(); node = runtimeServices.parse(reader,templateName);
在我的Windows机器上,它工作正常,但在Linux系统(Ubuntu 10.04)不起作用。 这篇文章对我没有什么帮助,因为我还没有find任何线索,我不得不给予写权限。
如何导出窗口事件日志与详细消息
gdb:logging的东西,而不是打破?
Windows事件日志vs文本日志
Git:将文件分割到新的存储库中
我发现,下面的代码也在Linux机器上工作:
String logPath = request.getRealPath("/veLocity.log"); RuntimeSingleton.setProperty( RuntimeConstants.RUNTIME_LOG,logPath ); runtimeServices = RuntimeSingleton.getRuntimeServices(); node = runtimeServices.parse(reader,templateName);
这不是一个很好的解决scheme,因为我永远不能确定,如果我有我的真正的上下文path的写权限。 最好的办法就是closuresveLocity的logging。
我必须设置什么不同的日志loggingconfiguration? NullLogChute只是不工作,或者我不适合使用它吗?
提前致谢!
WinForm应用程序应该在哪里保存日志?
Elastic Beanstalk上的Docker部署不收集Nginx日志
跨平台日志macros不能在Windows上工作
嗨问题是在写权限的fs保护。 事实上在你的堆栈跟踪你有:
java.io.FileNotFoundException: veLocity.log (Permission denied)
所以好的东西决定在什么地方写速度日志。 而且你说一个好话,你不知道在生产中,你可以写一个特定的路径。 所以最好把这个路径放在sysadmin可以修改的属性文件中。
所以检查这个我的答案,如果可以帮助你的另一篇文章。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。