APISonar


org.apache.camel.util.CamelLogger.log

> org > apache > camel > util > CamelLogger > log
org APIs apache APIs camel APIs util APIs CamelLogger APIs log APIs

Example 1
private final CamelLogger logger;

    protected void doLog(String message) {
        lastLogActivity = message;
        lastLogActivityTimestamp = System.currentTimeMillis();
        // verbose implies regular log as well
        lastVerboseLogActivity = lastLogActivity;
        lastVerboseLogActivityTimestamp = lastLogActivityTimestamp;
        logger.log(message, endpoint.getTransferLoggingLevel());
    }
Example 2
private CamelLogger log;

    public boolean process(Exchange exchange, AsyncCallback callback) {
        if (log.shouldLog()) {
            log.log(formatter.format(exchange));
        }
        callback.done(true);
        return true;
    }
Example 3
private CamelLogger log;

    public void process(Exchange exchange, String message) {
        if (log.shouldLog()) {
            String output = formatter.format(exchange) + message;
            if (maskingFormatter != null) {
                output = maskingFormatter.format(output);
            }
            output = fireListeners(exchange, output);
            log.log(output);
        }
    }
Example 4
private final CamelLogger logger = new CamelLogger(LOG, loggingLevel);

    public void disableDebugger() {
        logger.log("Disabling debugger");
        try {
            enabled.set(false);
            ServiceHelper.stopService(debugger);
        } catch (Exception e) {
            // ignore
        }
        clearBreakpoints();
    }
Example 5
private CamelLogger log;

    public void process(Exchange exchange) {
        if (startTime == 0) {
            startTime = System.currentTimeMillis();
        }
        int receivedCount = receivedCounter.incrementAndGet();

        //only process if groupSize is set...otherwise we're in groupInterval mode
        if (groupSize != null) {
            if (receivedCount % groupSize == 0) {
                log.log(createLogMessage(exchange, receivedCount));
            }
        }
    }
Example 6
private final CamelLogger logger;

    public void handleException(String message, Exchange exchange, Throwable exception) {
        try {
            String msg = CamelExchangeException.createExceptionMessage(message, exchange, exception);
            boolean closed = ObjectHelper.getException(ClosedChannelException.class, exception) != null;
            if (closed) {
                logger.log(msg, exception, closedLoggingLevel);
            } else {
                logger.log(msg, exception);
            }
        } catch (Throwable e) {
            // the logging exception handler must not cause new exceptions to occur
        }
    }
Example 7
private final CamelLogger logger = new CamelLogger(LOG, loggingLevel);

    public void resetDebugCounter() {
        logger.log("Reset debug counter");
        debugCounter.set(0);
    }
Example 8
private final CamelLogger logger = new CamelLogger(LOG, loggingLevel);

    public void disableBreakpoint(String nodeId) {
        logger.log("Disable breakpoint " + nodeId);
        NodeBreakpoint breakpoint = breakpoints.get(nodeId);
        if (breakpoint != null) {
            breakpoint.suspend();
        }
    }
Example 9
protected Subject authenticate(SecurityAuthenticator authenticator, LoggingLevel deniedLoggingLevel, HttpPrincipal principal) {
        try {
            return authenticator.login(principal);
        } catch (LoginException e) {
            CamelLogger logger = new CamelLogger(LOG, deniedLoggingLevel);
            logger.log("Cannot login " + principal.getName() + " due " + e.getMessage(), e);
        }
        return null;
    }
Example 10
private final CamelLogger logger = new CamelLogger(LOG, loggingLevel);

    public String dumpTracedMessagesAsXml(String nodeId) {
        logger.log("Dump trace message from breakpoint " + nodeId);
        BacklogTracerEventMessage msg = suspendedBreakpointMessages.get(nodeId);
        if (msg != null) {
            return msg.toXml(0);
        } else {
            return null;
        }
    }
Example 11
private final CamelLogger logger;

    public boolean process(Exchange exchange, AsyncCallback callback) {
        try {
            String msg = expression.evaluate(exchange, String.class);
            logger.log(msg);
        } catch (Exception e) {
            exchange.setException(e);
        } finally {
            // callback must be invoked
            callback.done(true);
        }
        return true;
    }
Example 12
private final CamelLogger logger = new CamelLogger(LOG, loggingLevel);

    public void resumeAll() {
        logger.log("Resume all");
        // stop single stepping
        singleStepExchangeId = null;

        for (String node : getSuspendedBreakpointNodeIds()) {
            // remember to remove the dumped message as its no longer in need
            suspendedBreakpointMessages.remove(node);
            SuspendedExchange se = suspendedBreakpoints.remove(node);
            if (se != null) {
                se.getLatch().countDown();
            }
        }
    }
Example 13
private final CamelLogger logger = new CamelLogger(LOG, loggingLevel);

    public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, String value) {
        SuspendedExchange se = suspendedBreakpoints.get(nodeId);
        if (se != null) {
            logger.log("Breakpoint at node " + nodeId + " is updating message header on exchangeId: " + se.getExchange().getExchangeId() + " with header: " + headerName + " and value: " + value);
            if (se.getExchange().hasOut()) {
                se.getExchange().getOut().setHeader(headerName, value);
            } else {
                se.getExchange().getIn().setHeader(headerName, value);
            }
        }
    }