Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

tomcat - log4j logfile

Thread view: 
lchuchla2@o2.pl - 13 Nov 2007 14:26 GMT
hello,
i'm a software developer and i've got a problem with log4j log file.
i'd like to ask if there is an option in configuration file that
allows to create a new log file automatically each day.
i mean the old one is move to some archive and new is create and we've
got a daily log file
thanks for answers
chuchel
Lew - 13 Nov 2007 14:35 GMT
> hello,
> i'm [sic] a software developer and i've [sic] got a problem with log4j log file.
> i'd like to ask if there is an option in configuration file that
> allows to create a new log file automatically each day.
> i mean the old one is move to some archive and new is create and we've
> got a daily log file

<http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileApp
ender.html
>

Always check the documentation - it often has the answer you want.  This took
me less than a minute to find by checking the log4j web site.

Signature

Lew

lchuchla2@o2.pl - 13 Nov 2007 14:42 GMT
> lchuch...@o2.pl wrote:
> > hello,
[quoted text clipped - 11 lines]
> --
> Lew

thx
lchuchla2@o2.pl - 14 Nov 2007 15:40 GMT
hello again,

now i've got problem with config file.
it looks like that:

<appender name="FILE"
class="org.apache.log4j.DailyRollingFileAppender">
   <param name="File" value="test.log"/>
   <param name="DatePattern" value="'.'yyyy-MM-dd-HH-mm"/>
   <param name="Append" value="true"/>
   <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern" value="%d %-5p [%t] %C{2} - %m
%n"/>
   </layout>
 </appender>

and it doesnt work. it's set to do backup every minute but it doesnt.
someone knows how to use it ?
chuchel
lchuchla2@o2.pl - 15 Nov 2007 10:15 GMT
ok I've got config file and it looks quite good, but thats what i get:

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: t3artscc.log (Permission denied)

does anybady know whats wrong ?
Gordon Beaton - 15 Nov 2007 10:15 GMT
> ok I've got config file and it looks quite good, but thats what i get:
>
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: t3artscc.log (Permission denied)
>
> does anybady know whats wrong ?

It looks like the file doesn't exist, and you don't have permission to
create files in that directory.

/gordon

--


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.