• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing the Url's in a jsp

 
Joe Harry
Ranch Hand
Posts: 10082
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Is there a way to print the url hitting Tomcat. Are there any configuraton changes that I can set up in Tomcat so that I can do this??
[ March 25, 2007: Message edited by: Jothi Shankar Kumar Sankararaj ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Print them to where; the user's browser, a log file on the server?
 
Joe Harry
Ranch Hand
Posts: 10082
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Print them to the Tomcat console!
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are talking of the local URL that is being accessed, then that is being logged on the access log in the TOMCAT_HOME/logs file.

If you are talking of the REFERER header, then you could write a filter that is mapped to all requests which reads that from the request and logs it to System.out. That would also work for logging the local URL.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In tomcat/conf/server.xml there is an entry for a access-logging valve.
It is commented out by default.
If you uncomment it, it will log all access to tomcat in the standard logging format, recognized by Webalizer and the other popular log analyzing tools.

Depending on how you've installed and started Tomcat, stdout will either go to one of the log files under tomcat/logs or to the console.
There are free programs out there that will allow you to watch any log, in real time, just like the console.

In Unix the "tail -f" command will do this.
I've seen various free "tail" programs for windows.
Textpad also allows you to do this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic