[jboss-cvs] JBossCache/src/org/jboss/cache ...

Brian Stansberry brian.stansberry at jboss.com
Tue Feb 6 10:07:59 EST 2007


  User: bstansberry
  Date: 07/02/06 10:07:59

  Modified:    src/org/jboss/cache  CacheImpl.java
  Log:
  [JBCACHE-735] Append clusterName to the log category
  
  Revision  Changes    Path
  1.43      +23 -1     JBossCache/src/org/jboss/cache/CacheImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -b -r1.42 -r1.43
  --- CacheImpl.java	30 Jan 2007 18:02:04 -0000	1.42
  +++ CacheImpl.java	6 Feb 2007 15:07:59 -0000	1.43
  @@ -103,7 +103,7 @@
      /**
       * CacheImpl log.
       */
  -   private final static Log log = LogFactory.getLog(CacheImpl.class);
  +   private Log log = LogFactory.getLog(CacheImpl.class);
   
      private static final String CREATE_MUX_CHANNEL = "createMultiplexerChannel";
   
  @@ -543,6 +543,9 @@
       */
      public void create() throws Exception
      {
  +      // Include our clusterName in our log category
  +      configureLogCategory();
  +      
         // initialise the node factory and set this in the runtime.
         NodeFactory nf;
         if ((nf = configuration.getRuntimeConfig().getNodeFactory()) == null)
  @@ -3061,6 +3064,25 @@
         node.setFqn(newFqn);
      }
   
  +   /**
  +    * Set our log category to include our clusterName, if we have one.
  +    */
  +   private void configureLogCategory()
  +   {
  +      StringBuffer category = new StringBuffer(getClass().getName());
  +      if (configuration != null)
  +      {
  +         String clusterName = configuration.getClusterName();
  +         if (clusterName != null)
  +         {
  +            category.append('.');
  +            category.append(clusterName);
  +         }
  +      }
  +      
  +      log = LogFactory.getLog(category.toString());
  +   }
  +
      protected class MessageListenerAdaptor implements ExtendedMessageListener
      {
         /**
  
  
  



More information about the jboss-cvs-commits mailing list