logging to only one file with multiple Loggers
I'd like to know if there's a possible way to log to one file with java.util.Logger, when I have more than one Loggers. I'm currently working on a web application that has a few servlets in it. Each of them has a static Logger for logging some events, they should all log these events into the same log file (a FileHandler is appended to the Loggers with the same log file name given in the FileHandlers' constructors). The loggers are initialized in the servlets' init() methods. After running the project, there's only one servlet's log information in the log file. Why is this?
And another question. I have a class that extends ApplicationContextListener. I've tried to do some logging in the contextInitialized and contextDestroyed methods, because I wanted to log the time when the application starts and ends. The result was: the contextDestroyed method ran 5 seconds after contextInitialized according to the log. But how is this possible? Isn't the ontextDestroyed supposed to run when the context is destroyed?
Thanks in advance.
|All times are GMT. The time now is 02:07 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.