This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Also, I can get logging to work as above in servlets, but how do I get it to work in Beans where I can't use getServletContext?
You could implement a ServletContext listener that stores the ServletContext in a singleton, and have the beans retrieve it from there. Better yet, have the singleton implement any logging methods you need, passing the arguments through to the ServletContext. I'm not sure what bad side effects this approach might have though.