- This topic has 4 replies, 2 voices, and was last updated 20 years, 9 months ago by
nupstone.
-
AuthorPosts
-
nupstoneMemberHi,
I’ve just discovered the easy way to debug struts apps. Add log4j to my WEB-INF/lib folder, and put the following in WEB-INF/classes/log4j.properties
# Global logging configuration log4j.rootLogger=ERROR, stdout # Struts log4j.logger.org.apache.struts.action=DEBUG # My app - based on ibatis pattern log4j.logger.com.ibatis.struts.BeanAction=DEBUG # Console output... log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
How about configuring some logging by default. It’s great, and would have saved me a day learning the hard way (in total).
Yep.. I could have bought a book too… but just learned more in 5 mins watching what happens when I navigate a web app than from all I gleaned from PDFs and web pages on Struts.
😀
October 5, 2004 at 10:07 pm #216951
Riyad KallaMemberI don’t know that we will go changing our wizards right away though as its best for us (as a tool provider) to provide the most default out-of-box experience. This logging information is covered in the Struts docs, so I suppose if anyone was so inclined they would hunt it down or search for this post 😉
Again thank you for posting it, it is an excellent source of information.
October 6, 2004 at 4:14 am #216967
nupstoneMemberThanks Riyad.
Yes. The more we share what works, the more chance of finding what we need somewhere like in these forums.When you say “most default out-of-box experience”, I don’t get that that works for developers.
What you provide us with is an IDE, which contains a debugger. I invite you to reconsider the notion of what a debugger is.
I propose that a powerful debugger is a tool that gives you the fastest route to finding why something didn’t work.
So, if I were developing the struts code, then a Java source level debugger would be useful. However, if I’m developing Struts-based solutions, especially if I’m only restructuring by making changes to struts-config.xml and to JSP pages, the Java debugger is going to be of little use for me.
I that case, my “debugger” is having the struts.action package showing me what’s happening.
I think that a log4j configurator as part of MyEclipse would be awesome, you could turn on/off debug levels from the package tree 😀
Do you get where we’re coming from here ? Maybe the thing is not so much struts, as giving really quick and direct access to logging for all Web apps.
Many thanks.
Neale
October 6, 2004 at 8:36 am #216980
Riyad KallaMemberNeale,
As far as being a developer is concerned, I think this is a really cool idea… let me pass it by some others.October 8, 2004 at 8:30 am #217229
nupstoneMemberYeah… I surprised myself with that one 8)
-
AuthorPosts