aspose file tools*
The moose likes Websphere and the fly likes How to get server log location of websphere at run time in our application (servlet or jsp) ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to get server log location of websphere at run time in our application (servlet or jsp) ?" Watch "How to get server log location of websphere at run time in our application (servlet or jsp) ?" New topic
Author

How to get server log location of websphere at run time in our application (servlet or jsp) ?

Rathi Subramani
Greenhorn

Joined: Jan 12, 2012
Posts: 3
Hi,
I took the server log path of jboss using this System.getProperty("jboss.server.log.dir"). But i don know how can i get for Websphere and weblogic. I tried in the same way as i did for jboss but i couldnt find the solution.

Please any one help me to find the server log paths for websphere and weblogic.

Thanks.
Davide Longo
Greenhorn

Joined: Jan 18, 2012
Posts: 3

do you have a ServletContext?
if so, try with .getRealPath("")
Daniel Val
Ranch Hand

Joined: Jan 09, 2012
Posts: 44
Davide Longo wrote:do you have a ServletContext?
if so, try with .getRealPath("")


This does not solve the problem anyway, but one thing to confirm: getRealPath only works with app exploded. If yours is not, it will give either an error or an erroneous result.

Nevertheless, in the present day, using getRealPath is severely discouraged.

The other stuff: for the logs you need to probe somehow the logging configuration.

D.
Rathi Subramani
Greenhorn

Joined: Jan 12, 2012
Posts: 3
Hi,

i tried getRealPath also... But i didnt get the actual result as i expected.

I got result by tried like this...

Websphere:logPath = System.getProperty("user.install.root").concat("/").concat("logs");

Weblogic:logPath = System.getProperty("user.dir").concat("/").concat("servers").concat("/").concat(System.getProperty("weblogic.Name")).concat("/").concat("logs");


But i dont know how to get for clustered environment.. I need to get all the servers log in the clustered environment. Please have your suggestions here......
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Maybe you won't like this, but my suggestion would be to stop wanting that. Perhaps there is a better way for you to do whatever it is you want to do; messing about with the server logs may not be a good idea. So why don't we start with what it is you actually want to do?
Rathi Subramani
Greenhorn

Joined: Jan 12, 2012
Posts: 3
Hi,

If several nodes of an appserver(jboss,Weblogic,Websphre) is running (means appserver in cluster) in the same machine or in different machines. i need to collect all the logs of all the nodes and need to zip them. This is my requirement. How can do it ?. Please have your suggestions.

Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get server log location of websphere at run time in our application (servlet or jsp) ?