Package org.apache.commons.logging

Examples of org.apache.commons.logging.Log


   
    public final static String HEADER_LOG_ID = "org.apache.synapse.transport.nhttp.headers";
    public final static String WIRE_LOG_ID = "org.apache.synapse.transport.nhttp.wire";

    public static NHttpClientHandler decorate(NHttpClientHandler handler) {
        Log log = LogFactory.getLog(handler.getClass());
        if (log.isDebugEnabled()) {
            handler = new LoggingNHttpClientHandler(log, handler);
        }
        return handler;
    }
View Full Code Here


        }
        return handler;
    }

    public static NHttpServiceHandler decorate(NHttpServiceHandler handler) {
        Log log = LogFactory.getLog(handler.getClass());
        if (log.isDebugEnabled()) {
            handler = new LoggingNHttpServiceHandler(log, handler);
        }
        return handler;
    }
View Full Code Here

                // request path object
                RequestPath requestPath = new RequestPath(app);

                String txname = req.getMethod() + ":" + req.getPath();
                Log eventLog = app.getEventLog();
                if (eventLog.isDebugEnabled()) {
                    eventLog.debug(txname + " starting");
                }

                int tries = 0;
                boolean done = false;
                Throwable error = null;
View Full Code Here

        if (!dirtyNodes.isEmpty()) {
            Object[] dirty = dirtyNodes.values().toArray();

            // the set to collect DbMappings to be marked as changed
            HashSet dirtyDbMappings = new HashSet();
            Log eventLog = nmgr.app.getEventLog();

            for (int i = 0; i < dirty.length; i++) {
                Node node = (Node) dirty[i];

                // update nodes in db
                int nstate = node.getState();

                if (nstate == Node.NEW) {
                    nmgr.insertNode(nmgr.db, txn, node);
                    dirtyDbMappings.add(node.getDbMapping());
                    node.setState(Node.CLEAN);

                    // register node with nodemanager cache
                    nmgr.registerNode(node);

                    if (hasListeners) {
                        insertedNodes.add(node);
                    }

                    inserted++;
                    if (eventLog.isDebugEnabled()) {
                        eventLog.debug("inserted node: " + node.getPrototype() + "/" +
                                node.getID());
                    }
                } else if (nstate == Node.MODIFIED) {
                    // only mark DbMapping as dirty if updateNode returns true
                    if (nmgr.updateNode(nmgr.db, txn, node)) {
                        dirtyDbMappings.add(node.getDbMapping());
                    }
                    node.setState(Node.CLEAN);

                    // update node with nodemanager cache
                    nmgr.registerNode(node);

                    if (hasListeners) {
                        updatedNodes.add(node);
                    }

                    updated++;
                    if (eventLog.isDebugEnabled()) {
                        eventLog.debug("updated node: " + node.getPrototype() + "/" +
                                node.getID());
                    }
                } else if (nstate == Node.DELETED) {
                    nmgr.deleteNode(nmgr.db, txn, node);
                    dirtyDbMappings.add(node.getDbMapping());

                    // remove node from nodemanager cache
                    nmgr.evictNode(node);

                    if (hasListeners) {
                        deletedNodes.add(node);
                    }

                    deleted++;
                    if (eventLog.isDebugEnabled()) {
                        eventLog.debug("removed node: " + node.getPrototype() + "/" +
                                node.getID());
                    }
                }

                node.clearWriteLock();
View Full Code Here

   *
   * @exception LogConfigurationException
   *              if a suitable <code>Log</code> instance cannot be returned
   */
  public Log getInstance(String name) throws LogConfigurationException {
    Log instance = null;
    // protect against concurrent access of loggerMap
    synchronized (loggerMap) {
      instance = (Log) loggerMap.get(name);
      if (instance == null) {
        Logger logger = LoggerFactory.getLogger(name);
View Full Code Here

  public void verify() throws IOException, ClassNotFoundException {
    ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
    ois = new ObjectInputStream(bis);

    Log resuscitatedLog = (Log) ois.readObject();
    // tests that the "private transient Logger logger" field is non-null
    resuscitatedLog.debug("");
    resuscitatedLog.isDebugEnabled();
  }
View Full Code Here

    oos.writeObject(log);
    verify();
  }

  public void testSmoke() throws Exception {
    Log log = LogFactory.getLog("testing");
    oos.writeObject(log);
    verify();
  }
View Full Code Here

            Object obj = ObjectUtils.instantiateSafely(providerClazz);
            if(obj != null && (obj instanceof FunctionProvider)) {
                FunctionProvider provider = (FunctionProvider) obj;
                final List<? extends BuiltInFunction> funcs = provider.injectedFunctions();
                if(funcs != null) {
                    final Log LOG = LogFactory.getLog(PredefinedFunctions.class);
                    for(BuiltInFunction f : funcs) {
                        QualifiedName qname = f.getName();
                        String name = QNameUtil.toLexicalForm(qname);
                        String prefix = qname.getPrefix();
                        if(BuiltInFunction.EXT_NSPREFIX.equals(prefix)) {
                            table.put(name, f);
                            String clazzName = f.getClass().getName();
                            r.put(name, clazzName);
                        } else {
                            LOG.warn("loading a BuiltInFunction is discarded: " + name);
                        }

                    }
                }
            } else {
                Log LOG = LogFactory.getLog(PredefinedFunctions.class);
                LOG.warn("Illegal FunctionProvider: " + providerClazz);
            }
        }
    }
View Full Code Here

            return invoked;
        }
    }
   
    protected Log getLog(JoinPoint jp) {
        Log log = null;
        try {
            LogDebug logdebug = this.getMethod(jp).getAnnotation(LogDebug.class);
            Class clazz = logdebug.loggerClass();
            if (clazz == null) clazz = LogDebugInterceptor.class;
            log = LogFactory.getLog(clazz);
View Full Code Here

        return log;
    }
   
    @Before("@annotation(es.internna.annotations.LogDebug)")
    public void beforeLog(JoinPoint jp) {
        Log log = this.getLog(jp);
        if (log.isDebugEnabled()) {
            log.debug(this.getMethod(jp));
            for (Object o : jp.getArgs())
            {
                if (o != null)
                {
                    log.debug("PARAMETER " + o.getClass().getSimpleName());
                    log.debug(o.toString());
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.logging.Log

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.