|
From: Mauro I. <mau...@en...> - 2010-09-15 09:54:37
|
Hi,
I'm running a simple WrapperListener class as a windows service. My service
does some logging using a default java.util.logging.Logger.
However, I noticed that messages sent to the logger during shutdown are not
logged.
This is some minimalistic code which reproduces the problem (feature?):
****************************************************************************
*************
****************************************************************************
*************
public class Main implements WrapperListener {
public static void main(String[] args) {
WrapperManager.start(new Main(), args);
}
public Integer start(String[] arg0) {
Logger.getLogger("").info("Starting up");
// do stuff here
System.out.println("Started");
return null;
}
public int stop(int exitCode) {
Logger.getLogger("").info("Shutting down");
// do stuff here
System.out.println("Stopped");
return exitCode;
}
}
****************************************************************************
*************
****************************************************************************
*************
And this is the output captured in the logfile:
****************************************************************************
*************
****************************************************************************
*************
STATUS | wrapper | 2010/09/15 11:11:14 | --> Wrapper Started as Console
STATUS | wrapper | 2010/09/15 11:11:14 | Java Service Wrapper Community
Edition 32-bit 3.5.3
STATUS | wrapper | 2010/09/15 11:11:14 | Copyright (C) 1999-2010 Tanuki
Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2010/09/15 11:11:14 |
http://wrapper.tanukisoftware.com
STATUS | wrapper | 2010/09/15 11:11:14 |
STATUS | wrapper | 2010/09/15 11:11:14 | Launching a JVM...
INFO | jvm 1 | 2010/09/15 11:11:14 | WrapperManager: Initializing...
INFO | jvm 1 | 2010/09/15 11:11:14 | 15-set-2010 11.11.14
java.util.logging.LogManager$RootLogger log
INFO | jvm 1 | 2010/09/15 11:11:14 | INFO: Starting up
INFO | jvm 1 | 2010/09/15 11:11:14 | Started
INFO | jvm 1 | 2010/09/15 11:11:15 | Stopped
STATUS | wrapper | 2010/09/15 11:11:17 | <-- Wrapper Stopped
****************************************************************************
*************
****************************************************************************
*************
As you can see, the second call to the logger is ignored.
Is there something I'm missing?
Sincerely,
Mauro
|