File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Cannot Stream (download) log4j files while Tomcat is up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cannot Stream (download) log4j files while Tomcat is up" Watch "Cannot Stream (download) log4j files while Tomcat is up" New topic
Author

Cannot Stream (download) log4j files while Tomcat is up

fletch zuniga
Greenhorn

Joined: Oct 04, 2012
Posts: 3
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

Joined: Jun 25, 2001
Posts: 16054
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
fletch zuniga
Greenhorn

Joined: Oct 04, 2012
Posts: 3
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

Joined: Jun 25, 2001
Posts: 16054
    
  21

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot Stream (download) log4j files while Tomcat is up