Concept of Logging in Apache NiFi

Last updated on May 30 2022
Swati Dogra

Table of Contents

Concept of Logging in Apache NiFi

Apache NiFi – Logging

Apache NiFi uses logback library to handle its logging. There is a file logback.xml present in the conf directory of NiFi, which is employed to configure the logging in NiFi. The logs are generated in logs folder of NiFi and the log files are as described below.

nifi-app. log

This is the main log file of nifi, which logs all the activities of apache NiFi application ranging from NAR files loading to the run time errors or bulletins encountered by NiFi components. Below is the default appender in logback.xml file for nifi-app.log file.

<appender name="APP_FILE"

class="ch.qos.logback.core.rolling.RollingFileAppender">

   <file>${org.apache.nifi.bootstrap.config.log.dir}/nifi-app.log</file>

   <rollingPolicy

      class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">

      <fileNamePattern>

         ${org.apache.nifi.bootstrap.config.log.dir}/

                     nifi-app_%d{yyyy-MM-dd_HH}.%i.log

      </fileNamePattern>

      <maxFileSize>100MB</maxFileSize>

      <maxHistory>30</maxHistory>

   </rollingPolicy>

   <immediateFlush>true</immediateFlush>

   <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">

      <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

   </encoder>

</appender>

The appender name is APP_FILE, and the class is RollingFileAppender, which means logger is using rollback policy. By default, the max file size is 100 MB and can be changed to the required size. The maximum retention for APP_FILE is 30 log files and can be changed as per the user requirement.

nifi-user.log

This log contains the user events like web security, web api config, user authorization, etc. Below is the appender for nifi-user.log in logback.xml file.

<appender name="USER_FILE"

   class="ch.qos.logback.core.rolling.RollingFileAppender">

   <file>${org.apache.nifi.bootstrap.config.log.dir}/nifi-user.log</file>

   <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

      <fileNamePattern>

         ${org.apache.nifi.bootstrap.config.log.dir}/

                     nifi-user_%d.log

      </fileNamePattern>

      <maxHistory>30</maxHistory>

   </rollingPolicy>

   <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">

      <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

   </encoder>

</appender>

The appender name is USER_FILE. It follows the rollover policy. The maximum retention period for USER_FILE is 30 log files. Below is the default loggers for USER_FILE appender present in nifi-user.log.

<logger name="org.apache.nifi.web.security" level="INFO" additivity="false">

   <appender-ref ref="USER_FILE"/>

</logger>

<logger name="org.apache.nifi.web.api.config" level="INFO" additivity="false">

   <appender-ref ref="USER_FILE"/>

</logger>

<logger name="org.apache.nifi.authorization" level="INFO" additivity="false">

   <appender-ref ref="USER_FILE"/>

</logger>

<logger name="org.apache.nifi.cluster.authorization" level="INFO" additivity="false">

   <appender-ref ref="USER_FILE"/>

</logger>

<logger name="org.apache.nifi.web.filter.RequestLogger" level="INFO" additivity="false">

   <appender-ref ref="USER_FILE"/>

</logger>

nifi-bootstrap.log

This log contains the bootstrap logs, apache NiFi’s standard output (all system.out written in the code mainly for debugging), and standard error (all system.err written in the code). Below is the default appender for the nifi-bootstrap.log in logback.log.

<appender name="BOOTSTRAP_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

   <file>${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log</file>

   <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

      <fileNamePattern>

         ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d.log

      </fileNamePattern>

      <maxHistory>5</maxHistory>

   </rollingPolicy>

   <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">

      <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

   </encoder>

</appender>

nifi-bootstrap.log file,s appender name is BOOTSTRAP_FILE, which also follows rollback policy. The maximum retention for BOOTSTRAP_FILE appender is 5 log files. Below is the default loggers for nifi-bootstrap.log file.

<logger name="org.apache.nifi.bootstrap" level="INFO" additivity="false">

   <appender-ref ref="BOOTSTRAP_FILE" />

</logger>

<logger name="org.apache.nifi.bootstrap.Command" level="INFO" additivity="false">

   <appender-ref ref="CONSOLE" />

   <appender-ref ref="BOOTSTRAP_FILE" />

</logger>

<logger name="org.apache.nifi.StdOut" level="INFO" additivity="false">

   <appender-ref ref="BOOTSTRAP_FILE" />

</logger>

<logger name="org.apache.nifi.StdErr" level="ERROR" additivity="false">

   <appender-ref ref="BOOTSTRAP_FILE" />

</logger>


So, this brings us to the end of Deep Dive into Apache NiFi User Interface blog. This Tecklearn ‘Concept of Logging in Apache NiFi’ helps you with commonly asked questions if you are looking out for a job in Apache NiFi and Big Data Domain.

If you wish to learn Apache NiFi and build a career in Apache NiFi or Big Data domain, then check out our interactive, Apace NiFi Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/apache-nifi-training/

Apache NiFi Training

About the Course

Tecklearn Apache NiFi Training makes you an expert in Cluster integration and the challenges associated, Usefulness of Automation, Apache NiFi configuration challenges and etc. Apache NiFi that helps you master various aspects of automating dataflow, managing flow of information between systems, streaming analytics, the concepts of data lake and constructs, various methods of data ingestion and real-world Apache NiFi projects .Transforming the databases is becoming a challenge for many organizations and thus they often look for those who have certification in Apache NiFi to help them in automating the flow of data between the systems.

Why Should you take Apache NiFi Training?

  • The Average Salary for Apache NiFi Developers is $96,578 per year. – paysa.com
  • Micron, Macquarie Telecom Group , Dovestech, Payoff, Flexilogix , Hashmap Inc. & many other MNC’s worldwide use Ansible across industries.
  • Apache NiFi is an open source software for automating and managing the flow of data between systems. It is a powerful and reliable system to process and distribute data. It provides a web-based User Interface for creating, monitoring, & controlling data flows.

What you will Learn in this Course?

Overview of Apache NiFi and its capabilities

  • Understanding the Apache NiFi
  • Apache NiFi most interesting features and capabilities

High Level Overview of Key Apache NiFi Features

  • Key features categories: Flow management, Ease of use, Security, Extensible architecture and Flexible scaling model

Advantages of Apache NiFi over other traditional ETL tools

  • Features of NiFi which make it different form traditional ETL tool and gives NiFi an edge over them

Apache NiFi as a Data Ingestion Tool

  • Introduction to Apache NiFi for data ingestion
  • Apache NiFi Processor : Data ingestion tools available for transferring , importing , loading and processing of data

Data Lake Concepts and Constructs (Big Data & Hadoop Environment)

  • Concept of data lake and its attributes
  • Support for colocation of data in various formats and overcoming the problem of data silos

Apache NiFi capabilities in Big Data and Hadoop Environment

  • Introduction to NiFi processors which sync with data lake and Hadoop ecosystem
  • An overview of the various components of the Hadoop ecosystem and data lake

Installation Requirements and Cluster Integration

  • Apache NiFi installation requirements and cluster integration
  • Successfully running Apache NiFi and addition of processor to NiFi
  • Working with attributes and Process of scaling up and down
  • Hands On

Apache NiFi Core Concepts

  • Apache NiFi fundamental concepts
  • Overview of FlowFile, Flow Controller ,FlowFile Processor, and their attributes
  • Functions in dataflow

Architecture of Apache NiFi

  • Architecture of Apache NiFi
  • Various components including FlowFile Repository, Content Repository, Provenance Repository and web-based user interface
  • Hands On

Performance Expectation and Characteristics of NiFi

  • How to utilize maximization of resources is particularly strong with respect to CPU and disk
  • Understand the best practices and configuration tips

Queuing and Buffering Data

  • Buffering of Data in Apache NiFi
  • Concept of queuing, recovery and latency
  • Working with controller services and directed graphs
  • Data transformation and routing
  • Processor connection, addition and configuration
  • Hands On

Database Connection with Apache NiFi

  • Apache NiFi Connection with database
  • Data Splitting, Transforming and Aggregation
  • Monitoring of NiFi and process of data egress
  • Reporting and Data lineage
  • Expression language and Administration of Apache NiFi
  • Hands On

Apache NiFi Configuration Best Practices

  • Apache NiFi configuration Best Practices
  • ZooKeeper access, properties, custom properties and encryption
  • Guidelines for developers
  • Security of Data in Hadoop and NiFi Kerberos interface
  • Hands On

Apache NiFi Project

  • Apache NiFi Installation
  • Configuration and Deployment of toolbar
  • Building a dataflow using NiFi
  • Creating, importing and exporting various templates to construct a dataflow
  • Deploying Real-time ingestion and Batch ingestion in NiFi
  • Hands On
Got a question for us? Please mention it in the comments section and we will get back to you.

 

0 responses on "Concept of Logging in Apache NiFi"

Leave a Message

Your email address will not be published. Required fields are marked *