Details

    • Type: Feature Request Feature Request
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: JBossAS-4.0.3RC1
    • Fix Version/s: JBossAS-4.0.3 Final
    • Component/s: Other
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      All Sun JVMs
    • Similar Issues:
      Show 10 results 

      Description

      Sun's LogManager has an undocumented feature where System.exit()
      invokes reset() on the LogManager.

      This causes problems for other Shutdown hooks like JBoss's that stops all services.
      i.e. the loggers can be reset while another shutdown hook still wants to use them

      A potential fix is to set the system property to install our own LogManager that
      disables reset. Instead we do the reset processing from
      our own shutdown hook.

      // psuedo code
      public class JBossLogManager extends LogManager
      {
      protected JBossLogManager()
      {
      }

      public void reset()

      { // do nothing }

      public void jbossReset()

      { super.reset(); }

      }

        Activity

        Hide
        Pankaj Kumar
        added a comment -

        I have the same issue mentioned in my blog entry and a work around at the application level: http://www.pankaj-k.net/archives/2005/08/jboss_shutdown.html

        Adrian, Thanks for commenting on my entry and letting me know about this JIRA issue.

        Show
        Pankaj Kumar
        added a comment - I have the same issue mentioned in my blog entry and a work around at the application level: http://www.pankaj-k.net/archives/2005/08/jboss_shutdown.html Adrian, Thanks for commenting on my entry and letting me know about this JIRA issue.
        Hide
        Scott Stark
        added a comment -

        I submitted a bug report with the following trivial example that illustrates the lack of output in the shutdown hook.

        package util.logging;

        import java.util.logging.Logger;

        public class TestLoggingShutdown
        {
        static class LoggerUser extends Thread
        {
        Logger log;

        LoggerUser()

        { log = Logger.getLogger("LoggerUser"); log.info("Created logger"); }

        public void run()

        { // This produces no output log.info("Shutdown hook running..."); }

        }

        public static void main(String[] args)

        { LoggerUser lu = new LoggerUser(); Logger log = Logger.getLogger("Main"); log.info("Registering shutdown hook"); Runtime.getRuntime().addShutdownHook(lu); log.info("Calling system exit"); System.exit(0); // This produces no output log.info("Exiting"); }

        }

        Show
        Scott Stark
        added a comment - I submitted a bug report with the following trivial example that illustrates the lack of output in the shutdown hook. package util.logging; import java.util.logging.Logger; public class TestLoggingShutdown { static class LoggerUser extends Thread { Logger log; LoggerUser() { log = Logger.getLogger("LoggerUser"); log.info("Created logger"); } public void run() { // This produces no output log.info("Shutdown hook running..."); } } public static void main(String[] args) { LoggerUser lu = new LoggerUser(); Logger log = Logger.getLogger("Main"); log.info("Registering shutdown hook"); Runtime.getRuntime().addShutdownHook(lu); log.info("Calling system exit"); System.exit(0); // This produces no output log.info("Exiting"); } }
        Hide
        Scott Stark
        added a comment -

        A org.jboss.logging.JBossJDKLogManager has been added that overrides the LogManager.reset() method to a noop. The server shutdown hook check to see if the LogManager is a JBossJDKLogManager at the end of the shutdown callout, and invokes the doReset() method to reset the logging layer.

        Show
        Scott Stark
        added a comment - A org.jboss.logging.JBossJDKLogManager has been added that overrides the LogManager.reset() method to a noop. The server shutdown hook check to see if the LogManager is a JBossJDKLogManager at the end of the shutdown callout, and invokes the doReset() method to reset the logging layer.

          People

          • Assignee:
            Scott Stark
            Reporter:
            Adrian Brock
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: