Debugging Magnolia
The purpose of this page is not to explain anyone how or why using a debugger; instead, we'll just go through a couple of Magnolia specific tips that might help understanding problems you might encounter.
Http session debugging
If you have http session related problems, it might be interesting to see the contents of your sessions, when they're created or what attributes are being added/removed from them. As from Magnolia 3.5, we provide the (very basic) SessionDebugger class to help with this matter. The SessionDebugger class is both a javax.servlet.Filter and an HttpSession*Listener.
To enable the filter, just register it in Magnolia's filter chain, ideally as the first one.
To enable the listener of session events, add the following to your web.xml:
<listener> <listener-class>info.magnolia.debug.SessionDebugger</listener-class> </listener>
Be careful, this logs A LOT (and in WARN mode), so you really want to disable this once you're done.
JCR session monitoring
Since Magnolia 3.5.7, we provide a simple JMX Mbean which allows you monitor the currently opened JCR sessions. Simply connect to your container (for instance using JConsole), and locate theMagnolia JCRStats MBean. It will show you how many JCR sessions currently opened.