应用程序无法在UNIX中创建日志文件? [英] Application cannot create log file in UNIX?

查看:142
本文介绍了应用程序无法在UNIX中创建日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个Web项目.这是使用log4j生成日志文件.但是,同一应用程序已部署在UNIX中,它也无法创建日志文件. 我是unix的新手.为什么不创建日志文件? 这是代码....

I have developed a web project. Which is generating log file using log4j. But the same application is deployed in UNIX, it is not able to create log file also..
I'm new to unix. Why it is not creating log file? This is the code....


log4j.rootLogger = INFO,CA, FA

#Console Appender
log4j.appender.CA = org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout = org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern =  %d  %5p %c{1}:%L - %m%n

#File Appender
log4j.appender.FA = org.apache.log4j.FileAppender
log4j.appender.FA.File =correspondence.log
log4j.appender.FA.layout = org.apache.log4j.PatternLayout
log4j.appender.FA.layout.ConversionPattern = %d  %5p [%t] - %m%n

它正在服务器安装文件夹中创建日志文件.但是不能在UNIX中创建.我需要做任何更改吗?

It is creating log file in server installation folder. But not creating in UNIX.. Any changes I have to do?

推荐答案

尝试更改该行:

log4j.appender.FA.File =correspondence.log

收件人:

log4j.appender.FA.File = /tmp/correspondence.log

如果可以,请在运行应用程序服务器的用户的主目录中创建一个日志目录,至少对其进行chmod修改,以使其可由所有者执行和写入,然后将其放入该目录中.

If it works, then create a log dir in the home directory of the user running the application server, chmod it at least to be executable and writable by owner and then put the log in that directory.

这篇关于应用程序无法在UNIX中创建日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆