我使用了velocity-1.6.2.jar
我的问题是 速度.log 在服务器启动下创建 jboss/bin
jboss/bin 有只读权限。
在我的应用程序中,当调用velocity-1.6.2.jar 时,我有这个错误:
Caused by: java.io.FileNotFoundException: velocity.log (Permission denied)
# ----------------------------------------------------------------------------
# default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute
# ----------------------------------------------------------------------------
runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute
# ---------------------------------------------------------------------------
# This is the location of the Velocity Runtime log.
# ----------------------------------------------------------------------------
runtime.log = velocity.log
最佳答案
Runtime log可以获得完整路径,因此只需将/home/velocity.log 直接登录到所需的文件夹
runtime.log = /home/velocity.log
Full path and name of log file for error, warning, and informational messages. The location, if not absolute, is relative to the 'current directory'.
import org.apache.velocity.app.VelocityEngine;
public class VelocityCustomEngine extends TemplateEngine {
private final VelocityEngine velocityEngine;
public VelocityCustomEngine() {
Properties properties = new Properties();
properties.setProperty("runtime.log", "/home/velocity.log");
this.velocityEngine = new VelocityEngine(properties);
}
}
https://stackoverflow.com/questions/46621916/
相关文章:
macos - 安装 Unity 和 Android SDK for Mac 时,adb 在哪里?
loops - JMeter while 循环(使用自己的索引停止循环)
nlp - gensim doc2vec "intersect_word2vec_format"命令
php - cakephp 3 编辑用户用户名和密码 - 无法找到当前实体的表类
macos - 在OS X上构建OpenSSH:配置:警告:sandbox.h:存在,但无法编译
javascript - JSON 到 XML 使用 Javascript