File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple apps pointing so same docbase locking the log files from rolling

 
uday s
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i have this issue with tomcat5.0 where logfiles are locked and not rolling due to multiple instances created through context path locking the same file.

here are more details:
1. the tomcat's appserver\conf\server.xml has following entry

<Context path="/sampleapp/app1" docBase="sampleapp" debug="0"
reloadable="true" />

<Context path="//sampleapp/app2" docBase="sampleapp" debug="0"
reloadable="true" />


This means that user might access app1 or app2 but would be pointed to a common application noted in docBase , here : sampleapp


2. Sample app has log4j.xml configured in to generate a log file in c:\sample_log.txt for rolling every one hour
\webapps\sampleapp\WEB-INF\classes\log4j.xml

3. the issue is the log file is not rolling out as it is locked by 3 different handles of same tomcat process id [ one for samplewebapp , app1 and app2]

4. app1 and app2 are vitually mapped to sampleapp but are contending with file as independant applications

5. when context path does not have app1 or app2 mapped to sampleapp base then the files are rolling fine [ but i cannot remove this as whole point of mapping is lost]

any ideas how to generate logfiles without contention between the apps ?
one way is to deploy duplicate apps for generating logs which is redundant?


Thanks,
UdaY
 
uday s
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,
Please let me know if i can add any more info that you might be looking for to answer the questions ?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search this
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
page for 'antiResourceLocking'.

I'm not sure if this flag will keep Tomcat from locking your log files but it's probably worth a shot.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just noticed that you said you're using 5.0 which, after searching, appears not to have this flag.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic