logging to only one file with multiple Loggers

Discussion in 'Java' started by temp00, Jun 25, 2008.

  1. temp00

    temp00

    Joined:
    Jun 25, 2008
    Messages:
    1
    Hi!

    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.
    temp00, Jun 25, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Shannon

    Logging with multiple loggers/handlers

    Jeff Shannon, Jul 6, 2004, in forum: Python
    Replies:
    3
    Views:
    338
    Jeff Shannon
    Aug 7, 2004
  2. Robert
    Replies:
    0
    Views:
    424
    Robert
    Aug 30, 2007
  3. nico
    Replies:
    3
    Views:
    438
    Arne Vajhøj
    Jan 19, 2008
  4. Rhino
    Replies:
    8
    Views:
    500
    markspace
    Apr 30, 2010
  5. Gábor Farkas
    Replies:
    0
    Views:
    161
    Gábor Farkas
    Nov 7, 2011
Loading...

Share This Page