Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot Stream (download) log4j files while Tomcat is up

 
fletch zuniga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks! I'm having a bit of a problem here. I have an ASP Application that displays log4j logfiles on a page for download. The logs are correctly displayed on the ASP Page but once I attempt to download them, I get an error. This is the weird part: When I close my Tomcat 6, the download is a-OK. Is there something I have to set on the Tomcat Configurations to enable log4j logs to be downloaded even while Tomcat is up?

Thanks.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that the giveaway is the word "ASP", since that means that it's virtually certain that you are running a Windows server.

Windows default file locking isn't very good on sharing.
 
fletch zuniga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir, i think you got it the other way around. my problem is that it appears that tomcat doesn't want to share files. the log4j files could only be streamed from the asp page ONLY IF tomcat is shutdown. perhaps something in tomcat can be tweaked to enable it to share
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I reiterate:
Windows default file locking isn't very good on sharing.


Tomcat has no OS-dependent code in it. I can read those files just fine in Linux, because the Linux OS filesystems don't lock files as exclusively by default as the Windows filesystems do.

You may be able to find a Log4j option that will allow better sharing, although I'm not optimistic, since the real issues are in Java itself and its write-once/run-everywhere approach to filesystem options. Meaning that (until recently), if an option wasn't common to ALL OS's (Windows, Linux, zOS, etc.), you simply couldn't code it in pure Java.

In any event, "Tomcat" has nothing to do with Log4j unless you have customized Tomcat by recompiling it. Normally only the webapps would be using Log4J. Tomcat's default logger is JULI.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic