• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rathi Subramani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you have a ServletContext?
if so, try with .getRealPath("")
 
Daniel Val
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic