I am trying to add a custom log handler to my java application. I have implemented a InnerLogger class that extends java.util.Logging.Handler class. And in my logging.properties declared as a handler:
handlers:com.mycompany.util.InnerLogger
But when I launch the development sever, I got the following error:
Can't load log handler "com.mycompany.util.InnerLogger"
java.lang.ClassNotFoundException: com.mycompany.util.InnerLogger
I can add my custom handler to loggers one by one ,but I just wondering is there a way to add it to all loggers.
Thanks
I was able to add a
Handlerto the rootLoggerwhen my application initializes. You can put this code in a warmup task or servlet filter.Its not as graceful as using logging.properties, but it is an adequate workaround when running on GAE.