{"id":4603,"date":"2020-09-01T13:26:50","date_gmt":"2020-09-01T07:56:50","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=4603"},"modified":"2024-10-15T18:35:56","modified_gmt":"2024-10-15T13:05:56","slug":"download-install-and-use-of-log4j-with-example-using-selenium","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/download-install-and-use-of-log4j-with-example-using-selenium\/","title":{"rendered":"Download, Install, and Use of Log4j  with Example using Selenium"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Log4j?<\/h2>\n\n\n\n<p>Log4j stands for Log for Java. It&#8217;s a straightforward, dependable, fast, and adaptable logging framework developed in Java. Log4j libraries are notable for their high configurability through external configuration files during runtime. Configuration for Log4j can be done using various types of files, such as XML, properties, JSON, etc. Additionally, Log4j has been adapted to languages beyond Java, including C, C++, Perl, Python, and C#.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Opt for Log4j?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open-Source:<\/strong> Log4j is an open-source tool, making it accessible and customizable.<\/li>\n\n\n\n<li><strong>Suitable for Projects of All Sizes:<\/strong> It finds utility in both small and large-scale projects.<\/li>\n\n\n\n<li><strong>Structured Flow Documentation:<\/strong> Log4j enables the storage of project flow details in files or databases.<\/li>\n\n\n\n<li><strong>Enhanced Status Insight:<\/strong> Instead of using regular output statements (SOPL), log statements within the code provide a clear picture of project status during execution. This aids in effective debugging and monitoring.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Main Components of Log4j:<\/h2>\n\n\n\n<p><strong>Loggers:<\/strong> Loggers are employed to record information. Implementing loggers in your project involves several steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create an instance of the logger class:<\/strong> The Logger class is a Java utility with pre-implemented generic methods for log4j usage.<\/li>\n\n\n\n<li><strong>Specify the Log4j level:<\/strong> There are five available log levels:\n<ul class=\"wp-block-list\">\n<li><strong>All:<\/strong> Captures everything at this level.<\/li>\n\n\n\n<li><strong>DEBUG:<\/strong> Logs debugging information, useful during development.<\/li>\n\n\n\n<li><strong>INFO:<\/strong> Logs informational messages to track application progress.<\/li>\n\n\n\n<li><strong>WARN:<\/strong> Logs problematic information and unexpected system behavior.<\/li>\n\n\n\n<li><strong>ERROR:<\/strong> Logs error messages to aid in troubleshooting while allowing the system to continue.<\/li>\n\n\n\n<li><strong>FATAL:<\/strong> Logs critical system information causing application crashes.<\/li>\n\n\n\n<li><strong>OFF:<\/strong> Disables logging.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>Appenders:<\/strong> Appenders deliver logging information to specified destinations such as databases, files, consoles, etc. Various types of appenders include:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ConsoleAppender:<\/strong> Logs to standard output.<\/li>\n\n\n\n<li><strong>File Appender:<\/strong> Prints logs to a designated file.<\/li>\n\n\n\n<li><strong>Rolling File Appender:<\/strong> Appends to a file with a maximum size. <\/li>\n\n\n\n<li><strong>Note: <\/strong>Appenders can be called by any name in the log4j properties.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Layouts:<\/strong> Layouts are used to format logging information in diverse styles.<\/li>\n<\/ol>\n\n\n\n<p>To manage logging activities, the Logger class offers various methods. It provides two static methods to obtain a Logger object.<\/p>\n\n\n\n<p><img fetchpriority=\"high\" decoding=\"async\" width=\"412\" height=\"123\" alt=\"static.PNG\" src=\"https:\/\/lh3.googleusercontent.com\/2ktEasS_99gqR8UTc1GPtiBpRaxwFDVZl9xWJN9MYMAhFNQL7qPhvAYHmmRv0cF30gCRGQ_Y5Yw-fs8sPgi2Hqb-KXS3Nn3VpI916pwMUiVcFCrLnzmLGnf80SkYfHi0HhcewjGmSy8Z-JuwBg\" title=\"\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Log4j:<\/h2>\n\n\n\n<p>To set up log4j, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Decide on the Appender:<\/strong> Determine which appender to use for configuration. Adjust the appender&#8217;s parameters accordingly.<\/li>\n\n\n\n<li><strong>Implement DEBUG Level and RollingFileAppender:<\/strong> Choose the DEBUG log level and configure the RollingFileAppender parameters.<\/li>\n\n\n\n<li><strong>Set Up Two Logs:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Root Logger:<\/strong> This logger records all system-generated logs and writes them to a file named &#8220;Testing.logs.&#8221;<\/li>\n\n\n\n<li><strong>Application Logger:<\/strong> This logger captures information generated by manual commands in the code and logs them to a file named &#8220;Manual.logs.&#8221;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Utilize the PatternLayout:<\/strong> Apply the PatternLayout for formatting.<\/li>\n<\/ol>\n\n\n\n<p>For the root logger, the configuration might look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">log4j.rootLogger=DEBUG,files\nlog4j.appender.files=org.apache.log4j.RollingFileAppender\nlog4j.appender.files.File=E:\\\\Testing\\\\src\\\\Testing.logs\nlog4j.appender.files.maxFileSize=800KB\nlog4j.appender.files.maxBackupIndex=6\nlog4j.appender.files.layout=org.apache.log4j.PatternLayout\nlog4j.appender.files.layout.ConversionPattern=%d{ABSOLUTE} %5p %c&lt;strong&gt;<strong>{1}<\/strong>&lt;\/strong&gt;:%L - %m%n\nlog4j.appender.files.Append=false\n<\/pre>\n\n\n\n<p><strong>Application Logs<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">log4j.logger.devpinoyLogger=DEBUG, dest2\nlog4j.appender.dest2=org.apache.log4j.RollingFileAppender\nlog4j.appender.dest2.maxFileSize=800KB\nlog4j.appender.dest2.maxBackupIndex=6\nlog4j.appender.dest2.layout=org.apache.log4j.PatternLayout\nlog4j.appender.dest2.layout.ConversionPattern=%d{dd\/MM\/yyyy HH:mm:ss} %c %m%n\nlog4j.appender.dest2.File=E:\\\\Testing\\\\src\\\\ManualTest.logs\nlog4j.appender.dest2.Append=false\n<\/pre>\n\n\n\n<p>In the provided example, we&#8217;ve configured log4j to save logs in two distinct files: &#8220;Testing.logs&#8221; and &#8220;ManualTest.logs.&#8221;<\/p>\n\n\n\n<p>In the configuration, &#8220;File&#8221; is utilized to specify the file name where the logs will be stored. Additionally, we have &#8220;dest2&#8221; and other identifiers.<\/p>\n\n\n\n<p>The &#8220;maxFileSize&#8221; parameter configures the maximum size of each log file. When the file size reaches this limit, a new file is created with the same name, and the old file is indexed.<\/p>\n\n\n\n<p>&#8220;maxBackupIndex&#8221; determines the maximum number of backup files to retain.<\/p>\n\n\n\n<p>The &#8220;layout&#8221; parameter sets the format for the log file.<\/p>\n\n\n\n<p>Setting &#8220;Append&#8221; to false will create new files for each logging instance rather than appending to existing files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use Log4j in Your Script:<\/h2>\n\n\n\n<p>In the code snippet below, we&#8217;ve employed &#8220;log&#8221; as a reference variable linked to the getLogger method of the Logger Class.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import org.apache.log4j.Logger;\n\npublic class ExampleClass {\n    private static final Logger log = Logger.getLogger(ExampleClass.class);\n\n    public static void main(String&#91;] args) {\n        log.debug(\"This is a debug message.\");\n        log.info(\"This is an info message.\");\n        log.warn(\"This is a warning message.\");\n        log.error(\"This is an error message.\");\n        log.fatal(\"This is a fatal message.\");\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Using Log4j with Selenium:<\/h2>\n\n\n\n<p><strong>Step 1:<\/strong> Open Eclipse and create a new project named &#8220;log4j_test.&#8221;<\/p>\n\n\n\n<p><strong>Step 2:<\/strong> Right-click on the &#8220;src&#8221; folder, then select &#8220;Build Path&#8221; and choose &#8220;Configure Build Path.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/hg1VU84YEdezZIPht0UtoDnBUm3ixcPHUAAA1_SPgYnPbIGkEQW2UPCXIvgF-i9R-W6QrNWjeFTYx02NpdlSGDIxe7ZADUXoPqdTFksJ659fPoiatYdTqHhzz-A8litJXpaWKbzGh0AIuvZRhw\" alt=\"log4j libraries\" title=\"\"><\/figure>\n\n\n\n<p><strong>Step 3:<\/strong> Navigate to the &#8220;Libraries&#8221; tab and incorporate Log4j libraries. You can obtain the Log4j libraries by downloading them from the following URL: https:\/\/logging.apache.org\/log4j\/1.2\/download.html<\/p>\n\n\n\n<p><strong>Step 4:<\/strong> Extract the downloaded Log4j file and integrate the Log4j libraries into your project.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Ms-R7xanb6VWtyD2-bkiM_rOOn7t6F5bwU14_VdM4DT-VKl0IvquFyJtHF8MBG1gJpX0deqWKoXQOEKtIqOm-5QxMf8YHctPoQr2u2FviZa1ps1K6vy1SzhCLoRRLSoUd5nUFrtZXFGR1XB-9A\" alt=\"log4j libraries\" title=\"\"><\/figure>\n\n\n\n<p><strong>Step 5:<\/strong> Generate a new file:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Right-click on the &#8220;src&#8221; folder.<\/li>\n\n\n\n<li>Choose &#8220;New,&#8221; then select &#8220;Other.&#8221;<\/li>\n\n\n\n<li>Under &#8220;General,&#8221; choose &#8220;File.&#8221;<\/li>\n\n\n\n<li>Input &#8220;log4j.properties&#8221; as the file name.<\/li>\n\n\n\n<li>Click on the &#8220;Finish&#8221; button.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Xtbmuwj7Nzc-4HYZX9wEpSSYTtjRuzbPl8w99NDyb5TRhfDdek2davIwp9_JY8nHupgmxZ_3uL3Kz6bzgXaLmUZoRGPScG8aOQ2gYSu0LjapIvBpxt47PstaUBtT88edr6mCSM7NzM9UHirzWQ\" alt=\"log4j properties\" title=\"\"><\/figure>\n\n\n\n<p>Create two additional files with the names &#8220;Testing.logs&#8221; and &#8220;ManualTest.logs.&#8221; These files will contain all the logs generated by the system and manually logged statements, respectively.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/KLaO1e00ITzF6wHwYLgBV_BxmZ0AJg7VJ9BjNGIAAiaZ-zSJNAl16FFT_SffTcLvLLfcKaXZ1N8dalpGkf7DSt_kdgaebwjnS1FEQutIcBxRkevh1yymO00WcpTXexKkNHONF5Q00w5v7o27EQ\" alt=\"log4j properties\" title=\"\"><\/figure>\n\n\n\n<p><strong>Step 6:<\/strong> Copy the configuration in log4j.properties<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Root logger\nlog4j.rootLogger=DEBUG,files\nlog4j.appender.files=org.apache.log4j.RollingFileAppender\nlog4j.appender.files.File=D:\\\\selenium_log4j\\\\log4jDemo\\\\src\\\\Testing.logs\nlog4j.appender.files.maxFileSize=800KB\nlog4j.appender.files.maxBackupIndex=6\nlog4j.appender.files.layout=org.apache.log4j.PatternLayout\nlog4j.appender.files.layout.ConversionPattern=%d{ABSOLUTE} %5p %c&lt;strong&gt;<strong>{1}<\/strong>&lt;\/strong&gt;:%L - %m%n\nlog4j.appender.files.Append=false\n\n#Application Logs\nlog4j.logger.devpinoyLogger=DEBUG, dest1\nlog4j.appender.dest1=org.apache.log4j.RollingFileAppender\nlog4j.appender.dest1.maxFileSize=800KB\nlog4j.appender.dest1.maxBackupIndex=6\nlog4j.appender.dest1.layout=org.apache.log4j.PatternLayout\nlog4j.appender.dest1.layout.ConversionPattern=%d{dd\/MM\/yyyy HH:mm:ss} %c %m%n\nlog4j.appender.dest1.File=D:\\\\selenium_log4j\\\\log4jDemo\\\\src\\\\ManualTest.logs\nlog4j.appender.dest1.Append=false<\/pre>\n\n\n\n<p><strong>Step 7:<\/strong> Generate a Main Class<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Right-click on the &#8220;src&#8221; directory.<\/li>\n\n\n\n<li>Choose &#8220;New,&#8221; then select &#8220;Class.&#8221;<\/li>\n\n\n\n<li>Enter the class name as &#8220;Log4jDemo.&#8221;<\/li>\n\n\n\n<li>Click on the &#8220;Finish&#8221; button.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>package<\/strong> log4j_test;\n\n<strong>import<\/strong> java.util.concurrent.TimeUnit;\n\n<strong>import<\/strong> org.apache.log4j.Logger;\n<strong>import<\/strong> org.apache.log4j.PropertyConfigurator;\n<strong>import<\/strong> org.openqa.selenium.By;\n<strong>import<\/strong> org.openqa.selenium.WebDriver;\n<strong>import<\/strong> org.openqa.selenium.firefox.FirefoxDriver;\n\n<strong>public<\/strong> <strong>class<\/strong> Log4jDemo {\n\n<strong>public<\/strong> <strong>static<\/strong> <strong>void<\/strong> main(String&#91;] args) {\nSystem.<em>setProperty<\/em>(\"webdriver.gecko.driver\",\"F:\\\\drivers\\\\geckodriver.exe\");\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0 WebDriver driver = <strong>new<\/strong> FirefoxDriver();\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Logger log = Logger.<em>getLogger<\/em>(\"devpinoyLogger\");\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0driver.get(\"https:\/\/www.google.co.in\");\nlog.debug(\"opening webiste\");\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0driver.manage().timeouts().implicitlyWait(20, TimeUnit.<strong><em>SECONDS<\/em><\/strong>);\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0driver.findElement(By.<em>name<\/em>(\"q\")).sendKeys(\"Selenium\");\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0log.debug(\"Entered Selenium Keyword\");\n\n}\n}<\/code><\/pre>\n\n\n\n<p>We establish system-level logs using the command: <code>Logger.getLogger(\"devpinoyLogger\")<\/code>.<\/p>\n\n\n\n<p>To store data in the &#8220;Manual.log&#8221; file, we utilize the <code>log.debug<\/code> method.<\/p>\n\n\n\n<p>Step 8: Execute the script and navigate to the locations of &#8220;ManualTest&#8221; and &#8220;Testing&#8221; logs to inspect the logged data.<\/p>\n\n\n\n<p>XML File Configuration with Log4j:<\/p>\n\n\n\n<p>Log4j&#8217;s logging system can also be configured using an <a href=\"https:\/\/www.h2kinfosys.com\/blog\/what-is-xml\/\">XML configuration file<\/a>. Below are the steps to set up log4j libraries using XML:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/ef3aXF0z283uqn7gcpNQcynu0sMqwtOToA46H3Ewn_stWbwVfQNAmtauZkej617cgm37tDfSF8TXo2IXP8fUAbGcYCuRTnbQIVvYlAg-LPc8xf62rpGJDSNzgYGfmMeJx0qlQ1Mfma-TawBwYg\" alt=\"XML File Configuration with Log4j\" title=\"\"><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The attributes enclosed between <code>&lt;appender&gt;<\/code> and <code>&lt;\/appender&gt;<\/code> define the properties of the appender component.<\/li>\n\n\n\n<li>The attribute &#8220;name&#8221; with the values &#8220;fileAppender&#8221; and &#8220;Rolling file appender&#8221; signifies the utilization of the RollingFileAppender as the output type.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"631\" height=\"54\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-15.png\" alt=\"\" class=\"wp-image-4607\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-15.png 631w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-15-300x26.png 300w\" sizes=\"(max-width: 631px) 100vw, 631px\" \/><\/figure>\n\n\n\n<p>3. The &#8220;name&#8221; attribute with the value &#8220;File&#8221; indicates that it is a file-based appender, and the &#8220;file&#8221; attribute points to the location where the output should be stored.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"615\" height=\"39\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-16.png\" alt=\"\" class=\"wp-image-4608\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-16.png 615w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-16-300x19.png 300w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p>4. The <code>&lt;layout&gt;<\/code> tag specifies the type of layout desired in the output, in this case, a pattern layout.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"613\" height=\"35\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-17.png\" alt=\"\" class=\"wp-image-4609\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-17.png 613w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-17-300x17.png 300w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/><\/figure>\n\n\n\n<p>5. The <code>&lt;priority&gt;<\/code> tag defines the priority level.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"39\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-18.png\" alt=\"\" class=\"wp-image-4610\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-18.png 624w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-18-300x19.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Integration of XML with Log4j<\/strong><\/h2>\n\n\n\n<p>1. Create a Java class and create an object for logger class using getLogger() method from Logger class.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"30\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-19.png\" alt=\"\" class=\"wp-image-4611\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-19.png 626w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-19-300x14.png 300w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/figure>\n\n\n\n<p>2. Load the xml file using configure method from the DOMConfigurator class<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"36\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-20.png\" alt=\"\" class=\"wp-image-4612\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-20.png 629w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-20-300x17.png 300w\" sizes=\"(max-width: 629px) 100vw, 629px\" \/><\/figure>\n\n\n\n<p>3. Log a message to the file<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"61\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-21.png\" alt=\"\" class=\"wp-image-4613\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-21.png 623w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-21-300x29.png 300w\" sizes=\"(max-width: 623px) 100vw, 623px\" \/><\/figure>\n\n\n\n<p><em>Complete program for XML integration with log4j<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"284\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-22.png\" alt=\"\" class=\"wp-image-4614\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-22.png 615w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-22-300x139.png 300w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p><strong>Conclusion:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Log4j\" rel=\"nofollow noopener\" target=\"_blank\">Log4j<\/a> is a simple, reliable, fast, and flexible login framework which is written in java language.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Log4j? Log4j stands for Log for Java. It&#8217;s a straightforward, dependable, fast, and adaptable logging framework developed in Java. Log4j libraries are notable for their high configurability through external configuration files during runtime. Configuration for Log4j can be done using various types of files, such as XML, properties, JSON, etc. Additionally, Log4j has [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":6882,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[156,1308,1307,1898,45,448,51],"class_list":["post-4603","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-selenium-tutorials","tag-automation-testing","tag-log4j-components","tag-log4j-libraries","tag-opt-for-log4j","tag-selenium","tag-selenium-webdriver","tag-software-testing"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/4603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=4603"}],"version-history":[{"count":0,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/4603\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/6882"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=4603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=4603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=4603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}