+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Log4j Interview Questions and Answers

What are different appenders that can configure in log4j?

There are different appenders that we can configure in log4j are: CONSOLE, FILES, DATABASE, JMS, EVENT LOGGING

Mainly used appenders:
CONSOLE in log4j:- If we use this as appenders in your application, log4j logs the information in the console or command prompt window that is started with startup script.
Files in log4j:- Files Appender is used to log the information into our custom name files. when we are configuring this appender, we can specify the file name.

Inside logger component what are the different log levels?

Different log levels inside logger components are

  • All
  • Debug
  • Info
  • Warn
  • Error
  • Fatal
  • Off
What are the three main components in log4j?

There are 3 main components that are used to log messages based upon type and level. These components also control the formatting and report place at runtime. These components are:

  • loggers
  • appenders
  • layouts
Explain what are Appenders in Log4j?

Appenders are used to deliver LogEvents to their destination. In simple words, it is used to write the logs in the file.

Explain why do you get multiple copies of the message in log file sometime?

There could be two reasons why this may happen

  • Repeated configuration of log4j
  • Attaching the same appenders to multiple loggers
Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.