Package org.jboss.logging

Examples of org.jboss.logging.Logger


      session.setMessageListener(new MessageListener()
      {
         public void onMessage(Message mess)
         {
            Logger log = Logger.getLogger(getClass().getName());
            log.debug("Processing message");
            try
            {
               if (mess instanceof TextMessage)
                  log.debug(((TextMessage) mess).getText());
            }
            catch (Exception e)
            {
               log.error("Error", e);
            }
         }
      });

      QueueSender sender = session.createSender(testQueue);
View Full Code Here


                }
                InputSource isrc = new InputSource(input);
                return isrc;
            }
        }
        Logger log = Logger.getLogger(MyEntityResolver.class);
        if (log.isDebugEnabled())
            log.debug("Resolve entity failed" + publicId + " " + systemId);
        log.error(Localizer.getMessage("jsp.error.parse.xml.invalidPublicId",
                publicId));
        return null;
    }
View Full Code Here

                }
                InputSource isrc = new InputSource(input);
                return isrc;
            }
        }
        Logger log = Logger.getLogger(MyEntityResolver.class);
        if (log.isDebugEnabled())
            log.debug("Resolve entity failed" + publicId + " " + systemId);
        log.error(Localizer.getMessage("jsp.error.parse.xml.invalidPublicId",
                publicId));
        return null;
    }
View Full Code Here

}

class MyErrorHandler implements ErrorHandler {

    public void warning(SAXParseException ex) throws SAXException {
        Logger log = Logger.getLogger(MyErrorHandler.class);
        if (log.isDebugEnabled())
            log.debug("ParserUtils: warning ", ex);
        // We ignore warnings
    }
View Full Code Here

}

class MyErrorHandler implements ErrorHandler {

    public void warning(SAXParseException ex) throws SAXException {
        Logger log = Logger.getLogger(MyErrorHandler.class);
        if (log.isDebugEnabled())
            log.debug("ParserUtils: warning ", ex);
        // We ignore warnings
    }
View Full Code Here

   @Override
   public void publish(LogRecord record)
   {
      if (isLoggable(record))
      {
         Logger logger = getJBossLogger(record);
         Level level = record.getLevel();
         Throwable th = record.getThrown();
        
         if (level == Level.FINER || level == Level.FINEST)
         {
            String msg = getMessage(record);
            logger.trace(msg, th);
         }
         else if (level == Level.FINE)
         {
            String msg = getMessage(record);
            logger.debug(msg, th);
         }
         else if (level == Level.INFO || level == Level.CONFIG || level == Level.ALL)
         {
            String msg = getMessage(record);
            logger.info(msg, th);
         }
         else if (level == Level.WARNING)
         {
            String msg = getMessage(record);
            logger.warn(msg, th);
         }
         else if (level == Level.SEVERE)
         {
            String msg = getMessage(record);
            logger.error(msg, th);
         }
         else if (level == Level.OFF)
         {
            // do nothing
         }
View Full Code Here

   }

   @Override
   public boolean isLoggable(LogRecord record)
   {
      Logger logger = getJBossLogger(record);
      Level level = record.getLevel();

      boolean isLoggable = false;
      if (level == Level.FINER || level == Level.FINEST)
      {
         isLoggable = logger.isTraceEnabled();
      }
      else if (level == Level.FINE)
      {
         isLoggable = logger.isDebugEnabled();
      }
      else if (level == Level.INFO || level == Level.CONFIG)
      {
         isLoggable = logger.isInfoEnabled();
      }
      else if (level == Level.SEVERE || level == Level.WARNING || level == Level.ALL)
      {
         isLoggable = true;
      }
View Full Code Here

      try
      {

         org.apache.log4j.BasicConfigurator.configure();
         org.apache.log4j.Category.getRoot().setLevel(Level.DEBUG);
         Logger log = Logger.getLogger(getClass());

         System.setProperty("jboss.identity", String.valueOf(System.currentTimeMillis()));

         MBeanServer server = MBeanServerFactory.createMBeanServer();

         NetworkRegistry registry = NetworkRegistry.getInstance();
         server.registerMBean(registry, new ObjectName("remoting:type=NetworkRegistry"));

         InvokerLocator locator = new InvokerLocator("socket://localhost");
         //ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();
         //SocketServerInvoker invokerSvr = new SocketServerInvoker(clsLoader, locator);
         //ObjectName objName = new ObjectName("jboss.remoting:type=SocketServerInvoker");
         //server.registerMBean(invokerSvr, objName);
         //invokerSvr.start();

         Connector connector = new Connector();
         connector.setInvokerLocator(locator.getLocatorURI());
         ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
         server.registerMBean(connector, obj);
         //connector.create();
         connector.start();

         Detector detector = null;
         ObjectName objName = null;

         if(type.equals(TYPE_MULTICAST))
         {
            MulticastDetector mdet = new MulticastDetector();
            mdet.setPort(port);
            detector = mdet;
            objName = new ObjectName("remoting:type=Detector,transport=multicast");
         }
         else if(type.equals(TYPE_JNDI))
         {
            JNDIDetector jdet = new JNDIDetector();
            jdet.setPort(port);
            jdet.setHost(host);
            jdet.setContextFactory(contextFactory);
            jdet.setURLPackage(urlPackage);
            detector = jdet;
            objName = new ObjectName("remoting:type=Detector,transport=jndi");
         }

         server.registerMBean(detector, objName);
         detector.start();
         System.err.println("Starting Detector");

         while(true)
         {
            Thread.currentThread().sleep(3000);
            NetworkInstance[] instances = registry.getServers();
            for(int x = 0; x < instances.length; x++)
            {
               log.debug(instances[x]);
            }
         }


      }
View Full Code Here

            order.addAll(jarsSet);
            jarsSet.clear();
            warMetaData.setNoOrder(true);
        }

        Logger log = Logger.getLogger("org.jboss.web");
        if (log.isDebugEnabled()) {
            StringBuilder builder = new StringBuilder();
            builder.append("Resolved order: [ ");
            for (String jar : order) {
                builder.append(jar).append(' ');
            }
            builder.append(']');
            log.debug(builder.toString());
        }

        warMetaData.setOrder(order);
        warMetaData.setOverlays(overlays);
        warMetaData.setScis(scis);
View Full Code Here

    * @return the logger
    */
   private Logger createLog()
   {
      Class<?> clazz = getClass();
      Logger logger = loggers.get(clazz);
      if (logger == null)
      {
         logger = Logger.getLogger(clazz);
         loggers.put(clazz, logger);
      }
View Full Code Here

TOP

Related Classes of org.jboss.logging.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.