You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Qgh <ja...@yahoo.com> on 2005/03/26 20:52:34 UTC
DailyRollingFileAppender - file path on Linux?
Hello all,
I am trying to configure LOG4J on my linux machine. I was successful on my
Windows XP machine.
My log4j.properties specifies the following for DailyRollingFileAppender
# dailyfile is a DailyRollingFileAppender
#
log4j.appender.dailyfile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.dailyfile.threshold=INFO
log4j.appender.dailyfile.file=/home/meuser/eclipse-projects/Testproject
/WEB-INF/logs/logfile.log
log4j.appender.dailyfile.datePattern='.'yyyy-MM-dd
log4j.appender.dailyfile.append=true
log4j.appender.dailyfile.layout=org.apache.log4j.PatternLayout
log4j.appender.dailyfile.layout.ConversionPattern=%-5p %d{ISO8601} [%t] - %m%n
But my code cannot seem to find the path to logfile.log.
This is the error that I get on my tomcat console -
Please help !
Thanks in advance
==========
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException:
/home/meuser/eclipse-projects/Testproject/WEB-INF/logs/logfile.log
(No such file
or directory)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:273)
at org.apache.log4j.FileAppender.activateOptions
(FileAppender.java:152)
at
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: DailyRollingFileAppender - file path on Linux?
Posted by Qgh <ja...@yahoo.com>.
Jacob Kjome <hoju <at> visi.com> writes:
>
> Does the "WEB-INF/ogs" directory actually exist?
Yes "WEB-INF/logs" directory exists.
It has 777 permission.
I think ususally linux explicitly says that permission denied - if permission
was the cause.
Here it says that file or directory does not exist.
SO I have a feeling that it is unable to find this path.
I am confused. Please help !
> Log4j will not create the
> directory for you if it doesn't already exist. You'll need to make sure
> that the directory where the log file is to be placed already exists
> (create it yourself by hand or programatically) before Log4j attempts to
> write the file. If it does exist, it could be a permissions problem.
>
> Jake
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: DailyRollingFileAppender - file path on Linux?
Posted by Jacob Kjome <ho...@visi.com>.
Does the "WEB-INF/ogs" directory actually exist? Log4j will not create the
directory for you if it doesn't already exist. You'll need to make sure
that the directory where the log file is to be placed already exists
(create it yourself by hand or programatically) before Log4j attempts to
write the file. If it does exist, it could be a permissions problem.
Jake
At 07:52 PM 3/26/2005 +0000, you wrote:
>Hello all,
>
>I am trying to configure LOG4J on my linux machine. I was successful on my
>Windows XP machine.
>My log4j.properties specifies the following for DailyRollingFileAppender
>
># dailyfile is a DailyRollingFileAppender
>#
>log4j.appender.dailyfile=org.apache.log4j.DailyRollingFileAppender
>log4j.appender.dailyfile.threshold=INFO
>log4j.appender.dailyfile.file=/home/meuser/eclipse-projects/Testproject
>/WEB-INF/logs/logfile.log
>log4j.appender.dailyfile.datePattern='.'yyyy-MM-dd
>log4j.appender.dailyfile.append=true
>log4j.appender.dailyfile.layout=org.apache.log4j.PatternLayout
>log4j.appender.dailyfile.layout.ConversionPattern=%-5p %d{ISO8601} [%t] -
%m%n
>
>
>But my code cannot seem to find the path to logfile.log.
>This is the error that I get on my tomcat console -
>
>Please help !
>
>Thanks in advance
>
>==========
>log4j:ERROR setFile(null,true) call failed.
>java.io.FileNotFoundException:
>/home/meuser/eclipse-projects/Testproject/WEB-INF/logs/logfile.log
>(No such file
>or directory)
> at java.io.FileOutputStream.openAppend(Native Method)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
> at org.apache.log4j.FileAppender.setFile(FileAppender.java:273)
> at org.apache.log4j.FileAppender.activateOptions
>(FileAppender.java:152)
> at
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org