You can set breakpoints in your code in a class library just like any other project and when your code is invoked it will stop at your breakpoint. The startup project would need to be the mojoPortal web project and you'd need to build the whole soution in debug mode.
I don't really have any good advice for debugging in a production environment, but if you are getting unexpected things on production that you can't produce in your dev environment then logging is a good option. I'd do thorough testing in the dev environment first.
Hope that helps,