APISonar


org.apache.nifi.logging.ComponentLog.log

> org > apache > nifi > logging > ComponentLog > log
org APIs apache APIs nifi APIs logging APIs ComponentLog APIs log APIs

Example 1
private final ComponentLog logger;

    public void log(LogLevel level, String msg, Object[] os, Throwable t) {
        if (isTerminated()) {
            logger.debug(getMessage(msg, level), os, t);
            return;
        }

        logger.log(level, msg, os, t);
    }
Example 2
protected void executeAction(Action action, Map<String, Object> facts) {
        ComponentLog logger = getLogger();
        Map<String, String> attributes = action.getAttributes();
        final String logLevel = attributes.get("logLevel");
        final LogLevel level = getLogLevel(logLevel, LogLevel.valueOf(defaultLogLevel));
        final String eventMessage = StringUtils.isNotEmpty(attributes.get("message")) ? attributes.get("message") : defaultLogMessage;
        final String factsMessage = createFactsLogMessage(facts, eventMessage);
        logger.log(level, factsMessage);
    }