{"id":54854,"date":"2018-02-07T11:00:20","date_gmt":"2018-02-07T09:00:20","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=54854"},"modified":"2018-02-23T12:08:58","modified_gmt":"2018-02-23T10:08:58","slug":"log4j-priority-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/","title":{"rendered":"Log4j Priority Example"},"content":{"rendered":"<p>This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files.<\/p>\n<h2>1. Introduction<\/h2>\n<p>Log4J (<strong>Java<\/strong>) is a widely used logging framework for Java. It continues to grow continuously with the recent upgrade to Log4j2. Log4j supports logging via Logger, Appender and Layouts.<\/p>\n<p>Logger is the interaction point for the application and carries out the logging activity. It is used to specify the logging mode and the name of the logger. It also delivers logs to the specified destination with the help of the appender. The <strong>Appender<\/strong> delivers the log to the logging destination\u00a0i.e. console, file or database along with options to fine-tune the logging mechanism. Appenders generally have lifecycle configuration and filtering support. Filtering enables to filter the messages whose logging mode does not match the level configured. Log4j supports multiple predefined appenders and<span class=\"mceItemHidden\"> also helps create custom <span class=\"hiddenSpellError\">appenders<\/span>.<\/span><\/p>\n<p>Layout specifies the display format of the logs. The most commonly used layout for Log4j is <code>PatternLayout<\/code>. A sample pattern is <strong>%d [%t] %-5p (%F: %L) \u2013 %m%n. <\/strong>The format strings for the pattern are as follows:<\/p>\n<ul>\n<li>Date \u2013\u00a0 Full date till micro seconds.<\/li>\n<li>Thread \u2013 JVM thread logging the output.<\/li>\n<li>Logging Mode \u2013 INFO\/ERROR\/DEBUG\/WARN.<\/li>\n<li>Class \u2013 Java Class logging the output.<\/li>\n<li>Line number \u2013 Line number in java class.<\/li>\n<li>Message \u2013 The message logged.<\/li>\n<li>Default line separator -\/n unless specified otherwise.<\/li>\n<\/ul>\n<h2>2. Priority<\/h2>\n<p>Log4j supports the following priority levels:<\/p>\n<ul>\n<li><strong>OFF <\/strong>&#8211; turns off logging.<\/li>\n<li><strong>DEBUG<\/strong> &#8211; used generally for debugging purpose. i.e. development focused.<\/li>\n<li><strong>TRACE<\/strong> &#8211; similar to DEBUG but used to display more granular information for debugging.<\/li>\n<li><strong>INFO<\/strong> &#8211; used to display general information in logs. Mostly log analytic target these kind of logs. Hence it is the most used logging mode.<\/li>\n<li><strong>WARN<\/strong> &#8211; used to display warning but not errors. Most likely to indicate unmet dependencies and may or not result in errors.<\/li>\n<li><strong>ERROR<\/strong> &#8211; used to display errors in the application.<\/li>\n<li><strong>FATAL<\/strong> &#8211; used to display message just before the application halts.<\/li>\n<\/ul>\n<p>Log4j needs to log in any of the modes specified above. They are listed out in increasing order of priority.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><span style=\"text-decoration: underline;\"><em>Example Class<\/em><\/span><\/p>\n<pre class=\"brush:java;highlight:[7,8]\">package com.jcg.examples;\r\nimport org.apache.log4j.Logger;\r\npublic class LoggerMain {\r\npublic static final Logger logger = Logger.getLogger(LoggerMain.class);\r\npublic static void main(String[] args) {\r\nwhile (true) {\r\nlogger.info(\"This is a warn log\");\r\nlogger.debug(\"This is a debug log\");\r\n}\r\n}\r\n}\r\n<\/pre>\n<ul>\n<li>Line 4 configures a logger with name as the <code>com.jcg.examples.LoggerMain<\/code>.<\/li>\n<li>Line 7,8 indicates the method used ie logging level for this message.<\/li>\n<\/ul>\n<p>The next part is configuring the logger via XML file or properties. Below, we have used properties to provide a suitable configuration for the appender and the destination.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Configuration<\/em><\/span><\/p>\n<pre class=\"brush:xml;highlight:[1]\">log4j.rootLogger=DEBUG, console\r\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\r\nlog4j.appender.console.Target=System.out\r\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\r\nlog4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n\r\n<\/pre>\n<ul>\n<li>Line 1 specifies the threshold \/allowed log level for the application.<\/li>\n<\/ul>\n<p>Messages passing the threshold criteria will be displayed in the logging destination. The below screenshot shows the display of both the messages.<\/p>\n<p><figure id=\"attachment_55645\" aria-describedby=\"caption-attachment-55645\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_debug_level.jpg\"><img decoding=\"async\" class=\"wp-image-55645 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_debug_level.jpg\" alt=\"\" width=\"820\" height=\"550\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_debug_level.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_debug_level-300x201.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_debug_level-768x515.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-55645\" class=\"wp-caption-text\">log4j unfiltered logs<\/figcaption><\/figure><\/p>\n<h2>3. Filtering based on priority<\/h2>\n<p>Log4j supports filtering based on mode specified. Considering the same java example but with the below configuration, the results would be different.<\/p>\n<pre class=\"brush:xml;highlight:[1]\">log4j.rootLogger=WARN, console\r\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\r\nlog4j.appender.console.Target=System.out\r\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\r\nlog4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n\r\n<\/pre>\n<p><code>DEBUG<\/code> has less priority than <code>WARN<\/code>. Hence only messages logged with <code>warn<\/code> method will be displayed. Priority filters messages below the specified priority level. Generally in production, applications are run with error mode to filter other messages whereas in development environments it is set to DEBUG level to display all log messages to aid application debugging.<\/p>\n<p>The below screenshot shows only the filtered logs.<\/p>\n<p><figure id=\"attachment_55646\" aria-describedby=\"caption-attachment-55646\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_warn_level.jpg\"><img decoding=\"async\" class=\"wp-image-55646 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_warn_level.jpg\" alt=\"\" width=\"820\" height=\"552\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_warn_level.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_warn_level-300x202.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_warn_level-768x517.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-55646\" class=\"wp-caption-text\">log4j filtered logs<\/figcaption><\/figure><\/p>\n<p>Here is another variation of the configuration producing the same result as above.<\/p>\n<pre class=\"brush:xml;highlight:[1]\">log4j.rootLogger=INFO, console\r\nlog4j.appender.console=org.apache.log4j.ConsoleAppender\r\nlog4j.appender.console.Target=System.out\r\nlog4j.appender.console.layout=org.apache.log4j.PatternLayout\r\nlog4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n\r\n<\/pre>\n<p>We have specified the mode as <code>INFO<\/code>. <code>INFO<\/code> has higher priority than <code>DEBUG<\/code> but has less priority than <code>WARN<\/code>. So <code>WARN<\/code> messages will be displayed but <code>DEBUG<\/code> messages will be filtered.<\/p>\n<h2>4. Execution Steps<\/h2>\n<ol>\n<li>Import the example as a Maven project<\/li>\n<li>Maven will import the dependencies automatically<\/li>\n<li>Stop the running project in eclipse after 5 minutes<\/li>\n<\/ol>\n<h2>5. Download the Source code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/01\/Log4jExample.zip\"><b>Log4jPriorityExample<\/b><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J (Java) is a widely used logging framework for Java. It continues to grow continuously with the recent upgrade to Log4j2. Log4j supports logging via Logger, Appender and Layouts. Logger &hellip;<\/p>\n","protected":false},"author":148,"featured_media":13304,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[649],"tags":[1700],"class_list":["post-54854","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-log4j","tag-log-priority-levels"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Log4j Priority Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Log4j Priority Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-07T09:00:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-23T10:08:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rajagopal ParthaSarathi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@PS_Rajagopal\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rajagopal ParthaSarathi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\"},\"author\":{\"name\":\"Rajagopal ParthaSarathi\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85\"},\"headline\":\"Log4j Priority Example\",\"datePublished\":\"2018-02-07T09:00:20+00:00\",\"dateModified\":\"2018-02-23T10:08:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\"},\"wordCount\":640,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\",\"keywords\":[\"log priority levels\"],\"articleSection\":[\"Log4j\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\",\"name\":\"Log4j Priority Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\",\"datePublished\":\"2018-02-07T09:00:20+00:00\",\"dateModified\":\"2018-02-23T10:08:58+00:00\",\"description\":\"This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Log4j\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/log4j\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Log4j Priority Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85\",\"name\":\"Rajagopal ParthaSarathi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g\",\"caption\":\"Rajagopal ParthaSarathi\"},\"description\":\"Rajagopal works in software industry solving enterprise-scale problems for customers across geographies specializing in distributed platforms. He holds a masters in computer science with focus on cloud computing from Illinois Institute of Technology. His current interests include data science and distributed computing.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/rajagopalparthasarathi\/\",\"https:\/\/x.com\/PS_Rajagopal\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/rajagopal-parthasarathi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Log4j Priority Example - Java Code Geeks","description":"This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/","og_locale":"en_US","og_type":"article","og_title":"Log4j Priority Example - Java Code Geeks","og_description":"This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-02-07T09:00:20+00:00","article_modified_time":"2018-02-23T10:08:58+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","type":"image\/jpeg"}],"author":"Rajagopal ParthaSarathi","twitter_card":"summary_large_image","twitter_creator":"@PS_Rajagopal","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Rajagopal ParthaSarathi","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/"},"author":{"name":"Rajagopal ParthaSarathi","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85"},"headline":"Log4j Priority Example","datePublished":"2018-02-07T09:00:20+00:00","dateModified":"2018-02-23T10:08:58+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/"},"wordCount":640,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","keywords":["log priority levels"],"articleSection":["Log4j"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/","name":"Log4j Priority Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","datePublished":"2018-02-07T09:00:20+00:00","dateModified":"2018-02-23T10:08:58+00:00","description":"This article is a tutorial about log priority levels in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-priority-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/"},{"@type":"ListItem","position":4,"name":"Log4j","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/log4j\/"},{"@type":"ListItem","position":5,"name":"Log4j Priority Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85","name":"Rajagopal ParthaSarathi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cfb94a81445054c9121aae84e08c1e89caaae406739df92517996b0e41492b48?s=96&d=mm&r=g","caption":"Rajagopal ParthaSarathi"},"description":"Rajagopal works in software industry solving enterprise-scale problems for customers across geographies specializing in distributed platforms. He holds a masters in computer science with focus on cloud computing from Illinois Institute of Technology. His current interests include data science and distributed computing.","sameAs":["https:\/\/www.linkedin.com\/in\/rajagopalparthasarathi\/","https:\/\/x.com\/PS_Rajagopal"],"url":"https:\/\/examples.javacodegeeks.com\/author\/rajagopal-parthasarathi\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/54854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/148"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=54854"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/54854\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/13304"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=54854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=54854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=54854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}