- This topic has 7 replies, 2 voices, and was last updated 19 years, 10 months ago by
Riyad Kalla.
-
AuthorPosts
-
leifwellsMemberI am a new MyEclipse user who is a little confused.
Until recently I’ve been using cygwin to “tail -f catalina.log” and have placed a lot of messages in my app so I can debug.
Since moving to MyEclipse and starting and stopping the server from the interface as well as watching the server output in the console window, I have noticed that I have lost all of my debugging printouts.
I have MyEclipse Tomcat 5 “Launch” setting set to Debug.
Am I misusing the console? Do I have MyEclipse (or Tomcat) poorly configured?
What am I doing wrong
Riyad KallaMemberWhat do your debug statements look like? What is the code you are using to print them out? Is it to a custom stream?
leifwellsMember@support-rkalla wrote:
What do your debug statements look like? What is the code you are using to print them out? Is it to a custom stream?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;public MonthSummary getDatesWithJournalEntryStatusForMonth(int month)
{
log.info(“************************** Attempting to getDatesWithJournalEntryStatusForMonth, month: ” + month);
User user = (User) getUserFromSession();
return this.studentDao.getDatesWithJournalEntryStatusForMonth(user, month);
}private static final Log log = LogFactory.getLog(FlashControllerImpl.class);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Here is an example of how the code is creating the log statements.
Thanks for the assist.
Leif
Riyad KallaMemberLeif,
What is the contents of your log properties file? The behiavor of the log is setup entirely by these configs files, I can’t really speak to why it’s not working yet because I don’t know how you’ve configured it.
leifwellsMember@support-rkalla wrote:
Leif,
What is the contents of your log properties file? The behiavor of the log is setup entirely by these configs files, I can’t really speak to why it’s not working yet because I don’t know how you’ve configured it.Thanks for your patience! Here’s my log4j.properties file contents.
Honestly, I have been dumped into this project and have never needed to set up log4j, so anything you can do to assist me would be deeply appreciated!
(In fact, I am going to show MyEclipse at the Atlanta Macromedia User Group tonight! http://www.altmmug.org)
Leif
~~~~~~~~~~
# Attach appender A1 to root. Set root priority to Prority.DEBUG.
log4j.rootCategory=DEBUG, A1# A1 is set to be a FileAppender sending its output to
# System.out. However, only error messages and above will be printed
# since the threshold is set to Priority.ERROR.# The fact that the root priority is set to Prority.DEBUG only
# influences log requests made to the root category. It has no
# influence on the appenders attached to root.log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.Threshold=ERRORlog4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) – %m%n# Appender A2 writes to the file “scribbles.log” in user’s home.
log4j.appender.A2=org.apache.log4j.FileAppender
log4j.appender.A2.File=${scribbles.root}/WEB-INF/scribbles.log# Set the category priorities to the appropritate levels
# and attach appender A2.
log4j.category.com.roundboxmedia.scribbles.controller=DEBUG, A2
log4j.category.com.roundboxmedia.scribbles.aspect=DEBUG, A2
log4j.category.com.roundboxmedia.scribbles.model=DEBUG, A2
log4j.category.org.apache.catalina=DEBUG, A2# Truncate ‘test’ if it aleady exists.
log4j.appender.A2.Append=false# Appender A2 uses the PatternLayout.
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%5r %-5p [%t] %c{2} – %m%n
Riyad KallaMember(In fact, I am going to show MyEclipse at the Atlanta Macromedia User Group tonight! http://www.altmmug.org)
Very cool!
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.Threshold=ERRORlog4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) – %m%nHmmm this actually looks just fine, your properties file is setup correctly and all the settings look valid, I can’t imagine why you aren’t seeing the console output.
Try this, try and add a System.out.println and System.err.println print outs in your code, so you see them in the console? Also is your properties file somewhere in your classpath so Commons Logger can find it? I wonder if it isn’t being deployed correctly with your project or something…
leifwellsMemberAlso is your properties file somewhere in your classpath so Commons Logger can find it? I wonder if it isn’t being deployed correctly with your project or something…
Nail on the head!
Thanks for assisting me with this problem. I had to get the log4j.properties file in the correct path for Tomcat to find it (although I am pretty sure that it isn’t in the correct folder yet, it is working).
Funny thing, I changed the threshhold to ALL — ouch. Now that’s some .out!
😉
Thanks again. This is REALLY gonna be a hit with the crowd tonight!
Riyad KallaMemberLeif,
Thank you for hanging in there, I’m glad we got this one figured out. Let us know how the presentation goes, maybe even start a new thread under ME > Comments forums if you feel it’s appropriate. -
AuthorPosts