MyEclipse: Finding Tomcat 6 logfiles when used as a server in Eclipse

kentucky_b - Feb 03, 2009 - 05:03 AM
Post subject: Finding Tomcat 6 logfiles when used as a server in Eclipse
I have Tomcat 6.0 installed as my server within MyEclipse 6.5. I'm having problems delivering pages at different times so would definitely find it useful to be able to readily go to the log files. i just can't seem to find the Tomcat log files. Can you help me?

Thanks.
ernestz - Feb 03, 2009 - 01:51 PM
Post subject: RE: Finding Tomcat 6 logfiles when used as a server in Eclip
When using the integrated "MyEclipse Tomcat6", the location of the log files would depend on your log configuration. Are you logging to ${catalina.home}, or ${catalina.base}?

Either way, to find theses locations, use Window -> Preferences -> MyEclipse Enterprise Workbench -> Servers -> Integrated Sandbox -> MyEclipse Tomcat 6 -> Launch, click on Create Launch Configuration, select the Arguments tab and the VM Arguments will show the default values for these two properties.
kentucky_b - Feb 03, 2009 - 05:53 PM
Post subject: Integrated Tomcat log files
Thank you so very much for the information you provided. I have used the VM arguments in an ordinary Eclipse environment. I am not familiar with using Tomcat integrated into MyEclipse so I'm struggling with the configuration.

Here are my VM arguments:

-Dcatalina.home=C:/Java/JavaSource/plugins/com.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806/tomcat

-Dcatalina.base=C:/development/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat

-Djava.endorsed.dirs=C:/Java/JavaSource/plugins/com.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806/tomcat/common/endorsed

-Djava.io.tmpdir=C:/development/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/temp

-Djava.library.path="C:/Program Files/Java/jre1.6.0_05/bin;C:/Java/JavaSource/plugins/com.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806/tomcat/bin"

-Dsun.io.useCanonCaches=false

I don't believe I have logging configured. Can you tell me how to do that in this environment?

Thank you so much.
ernestz - Feb 03, 2009 - 07:04 PM
Post subject: RE: Integrated Tomcat log files
How is your application logging information? Using something like Apache Commons Logging? Log4J? Both of these use configuration files.

Or, are you simply using System.out/System.err?
kentucky_b - Feb 03, 2009 - 11:43 PM
Post subject:
I am realizing I have not set up any logging. What do you recommend? This is the first project I've done that wasn't already in the works so to speak. Usually the logging was already configured. What I am most wanting to see now is why I'm getting "404's" instead of the page I am trying to access. I thought if I could see the server logs, I would know what the path the server is using to try to locate the files I'm not delivering or accessing. These are the servlets i want to access from my jsp's. They are in a package within the application. So, I'm wanting to see what Tomcat is writing to it's log files, not application error message right now.
ernestz - Feb 04, 2009 - 02:12 PM
Post subject:
I don't really use the integrated MyEclipse Tomcat server very much, and just tested and realized that even my own apps (which to do logging) when deployed to the MyEclipse Tomcat 6 server are not producing log files. There is something about the integrated MyEclipse Tomcat 6 server that is different than my stand-alone Tomcat 6 server.

I would have to examine/compare a standard Tomcat 6 server setup with the integrated MyEclipse Tomcat 6 server, but don't really have time at the moment.

This may be something MyEclipse support may be able to address and possibly explain the logging differences in the integrated MyEclipse Tomcat 6 and standard/standalone Tomcat6 servers.
ernestz - Feb 04, 2009 - 02:30 PM
Post subject:
ernestz wrote:
I don't really use the integrated MyEclipse Tomcat server very much, and just tested and realized that even my own apps (which to do logging) when deployed to the MyEclipse Tomcat 6 server are not producing log files.


I just discovered I tested with a simple application which does not actually log (oops). Another application I am working on that does do logging actually logs as expected. So application logging should work as expected.

It is just regular Tomcat logging that appears to be an issue.
kentucky_b - Feb 04, 2009 - 04:24 PM
Post subject:
I appreciate your help; you have given me some things to think about and implement. Can you recommend a tutorial or guide to implementing either of the application logging mechanisms you mentioned?

Thanks again.
ernestz - Feb 05, 2009 - 02:41 PM
Post subject:
Typically I use Log4J http://logging.apache.org/log4j/1.2/index.html.

As far as logs for the integrated MyEclipse Tomcat 6 server, I found out that the default configuration fails to define the required properties to perform server logging.

You will have to add the following property definitions to the integrated MyEclipse Tomcat 6 configuration. Use the following menu items, Window -> Perferences -> MyEclipse Enterprise Workbench -> Servers -> Integrated Sandbox -> MyEclipse Tomcat6 -> JDK. On the right pane, you will see a text box labelled Optional Java VM arguments. You should be able to copy/paste the following property definitions into that text box and save the changes.

-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="C:/development/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat /conf/logging.properties"

(The path use above is the catalina.base property you specified in your earlier post.)
kentucky_b - Feb 05, 2009 - 05:15 PM
Post subject:
Thanks; I will try this tonight and review the use of log4j. I know I have used it in the past. Coming along here now. Thank you.
kentucky_b - Feb 05, 2009 - 05:37 PM
Post subject:
I am thinking these two values do not make sense:

-Dcatalina.home=C:/Java/JavaSource/plugins/com.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806/tomcat

-Dcatalina.base=C:/development/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat

They should be more the same I think; your comment made me take a closer look.
ernestz - Feb 05, 2009 - 06:32 PM
Post subject:
For a normal Tomcat install, catalina.home and catalina.base default to the same value. But, catalina.home specifies the path to the actual Tomcat binaries.

catalina.base can be set to another path for the actual 'data' files, such as logs, configuration, webapps, etc.
kentucky_b - Feb 06, 2009 - 04:25 PM
Post subject:
Unfortunately I am still very confused. How can I determine which of my values are correct for the embedded Tomcat server with MyEclipse? How can I confirm where the "actual Tomcat binaries" are that I am using? I had read the home and base should be the same if I am using one install of Tomcat which I believe I am. I do have an independent installation of Tomcat on my laptop; but I am trying to use the embedded server. That is supposed to be simpler. that is my goal right now.
kentucky_b - Feb 06, 2009 - 04:32 PM
Post subject:
Unfortunately I am still very confused. How can I determine which of my values are correct for the embedded Tomcat server with MyEclipse? How can I confirm where the "actual Tomcat binaries" are that I am using? I had read the home and base should be the same if I am using one install of Tomcat which I believe I am. I do have an independent installation of Tomcat on my laptop; but I am trying to use the embedded server. That is supposed to be simpler. that is my goal right now.

Basically I am not sure whether the value of the base or the home is correct as they are now configured. My deepest appreciation.
ernestz - Feb 06, 2009 - 05:53 PM
Post subject:
The values supplied for the embedded Tomcat6 server in MyEclipse are correct. The catalina.home points to the binaries for the Tomcat server. The catalina.base points to the location of your conf/, webapps/, temp/, logs/.

MyEclipse's Tomcat configuration is setup by default and works 'out of the box'. With the exception of server logging which was pointed out in another thread.
kentucky_b - Feb 06, 2009 - 05:59 PM
Post subject:
Thanks; I was confused that the base and the home were not the same. I still can't access a servlet that I am calling from the action tag in an html page. I'm not sure what the problem can be now.
kentucky_b - Feb 08, 2009 - 01:41 AM
Post subject:
Please see a new topic I have posted; I think it might have to do with the values for home and base as I am using the wrong web.xml file i think. I think this is why I can not deliver the servlet. I am using the Kick Start book by Valcarcel. I think I am following the steps correctly there.
My context root is "/MyProject". When I look at the properties for MyProject, the project References tab has a Servers project checked. The only server there is Tomcat v6.0 Server at localhost hiwhc has it's own web.xml. Should this project not be checked?

I started out with a separate install of Tomcat; the I decided to use the embedded Tomcat v6.0 server. Perhaps I have confused myself with all this?
kentucky_b - Feb 12, 2009 - 10:52 PM
Post subject:
I do have catalina_home and catalina_base clear in my mind now; however, I still have not found where the embedded tomcat server is doing any logging after adding the two VM arguments as suggested above. Am I still missing something?
ernestz - Feb 13, 2009 - 01:50 PM
Post subject:
If the VM arguments were added correctly, the logs will be in the path specified as "${catalina.base}/logs".
kentucky_b - Feb 13, 2009 - 07:06 PM
Post subject:
Well, the puzzle continues then.

VM arguments:
-D catalina.home= C:/Java/JavaSource/plugins/com.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806/tomcat
-D catalina.base = C:/development/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat

However, there are no log files at : C:\development\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\logs
ernestz - Feb 13, 2009 - 11:10 PM
Post subject:
What about the VM arguments for "java.util.logging.manager" and "java.util.logging.config.file" I pointed out in post http://myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&p=102229#102229
kentucky_b - Feb 14, 2009 - 12:04 AM
Post subject:
Actually, the arguments in the other post are there:
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="C:/development/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat /conf/logging.properties"

but for some reason, the catalina.home and catalina.base are not there! I copied those values from a text document I'm keeping with the information from my research.
Obviously, I messed up, and I apologize.
kentucky_b - Feb 14, 2009 - 12:08 AM
Post subject:
I reread my notes, and took a look at the Integrated Sandbox. The catlina-home and catlina-base are in the VM arguments for the launch configuration.
I shall be very familiar with all the configuration options and screens. I am gratefjul for your patience.
javaboy88 - Apr 17, 2012 - 04:13 PM
Post subject:
I'm experiencing the same problem (finding the server log for the embedded Tomcat 6) in MyEclipse 10.1, but there is no "launch" under Integrated Sandbox/MyEclipse Tomcat 6. So, I cannot follow the previous advice to discover the value(s) of "catalina.base" and/or "catalina.home". It would be helpful to see the log in order to debug some bean configuration issues in my app.
support-swapna - Apr 18, 2012 - 05:47 AM
Post subject:
javaboy88 ,

Here is an FAQ on how to enable integrated tomcat logging :
http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=28938

The catalina.txt will contain log messages(e.g. those output via the java.util.logging.Logger class).

Let us know how it works for you.
javaboy88 - Apr 24, 2012 - 02:42 PM
Post subject: Finding MyEclipse embedded Tomcat 6 server logfiles
Okay, that's a good start. I have a server log now, but it only shows "info" messages. I really need "debug" level to see what is being configured.
support-swapna - Apr 25, 2012 - 06:41 AM
Post subject:
javaboy88,

Can you check if you can make changes to the logging.properties file as discussed in this thread ?
http://stackoverflow.com/questions/4119213/how-to-set-level-logging-to-debug-in-tomcat-6

Hope this helps.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits