{"id":55684,"date":"2018-03-05T11:00:52","date_gmt":"2018-03-05T09:00:52","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=55684"},"modified":"2018-03-05T10:32:25","modified_gmt":"2018-03-05T08:32:25","slug":"log4j-buffersize-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/","title":{"rendered":"Log4j BufferSize 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 i.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) -%m%n. <\/strong>The format strings for the pattern are as follows:<\/p>\n<ul>\n<li>Date &#8211; Full date until microseconds.<\/li>\n<li>Thread &#8211; JVM thread logging the output.<\/li>\n<li>Logging Mode &#8211; INFO\/ERROR\/DEBUG\/WARN.<\/li>\n<li>Class &#8211; Java Class logging the output.<\/li>\n<li>Line number &#8211; Line number in java class.<\/li>\n<li>Message &#8211; The message logged.<\/li>\n<li>Default line separator -\/n unless specified otherwise.<\/li>\n<\/ul>\n<h2>2. Standard Logging<\/h2>\n<p>In this section, we will cover the standard example of logging to a file via Log4j.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Example Class<\/em><\/span><\/p>\n<pre class=\"brush:java;highlight:[4,7]\">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\nIntStream.rangeClosed(1, 1000).forEach(count -&gt; {\r\nlogger.warn(\"This is a warn log\");\r\n}\r\n);\r\n} \r\n}<\/pre>\n<ul>\n<li>Line 4 configures a logger with the name as <code>com.jcg.examples.LoggerMain<\/code>.<\/li>\n<li>Line 7 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.<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>Configuration<\/em><\/span><\/p>\n<pre class=\"brush:xml;highlight:[1,2,5]\">log4j.rootLogger=WARN, fileLogger\r\nlog4j.appender.fileLogger=org.apache.log4j.FileAppender\r\nlog4j.appender.fileLogger.layout=org.apache.log4j.PatternLayout\r\nlog4j.appender.fileLogger.layout.ConversionPattern=%d [%t] %-5p (%F:%L) - %m%n\r\nlog4j.appender.fileLogger.File=example.log\r\n\r\n<\/pre>\n<ul>\n<li>Line 1 specifies the threshold \/allowed log level for the application.<\/li>\n<li>Line 2 specifies the type of appender used i.e. <code>FileAppender<\/code> for appending events to the file.<\/li>\n<li>In Line 5, we specify the output file name with the fully qualified path. In this example, the relative path is specified and the file will be created in the application directory.<\/li>\n<\/ul>\n<p>The below screenshot shows the logged messages to the file example.log created under application directory.<\/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=\"size-full wp-image-55646\" 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<h2>3. Buffered Logging<\/h2>\n<p>In this section, we will cover buffered logging with an example. Buffering is used to reduce IO operations. It stores the events in memory and directs log to the destination on reaching the buffer threshold.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Buffering Configuration<\/em><\/span><\/p>\n<pre class=\"brush:xml;highlight:[6]\">log4j.rootLogger=WARN, fileLogger\r\nlog4j.appender.fileLogger=org.apache.log4j.FileAppender\r\nlog4j.appender.fileLogger.layout=org.apache.log4j.PatternLayout\r\nlog4j.appender.fileLogger.layout.ConversionPattern=%d [%t] %-5p %m%n\r\nlog4j.appender.fileLogger.File=example.log\r\nlog4j.appender.fileLogger.bufferedIO = true\r\n<\/pre>\n<ul>\n<li>Here the conversion pattern does not include <code>%F<\/code> and <code>%L<\/code> flags. These slow down the logging performance.<\/li>\n<li><code>bufferedIO<\/code> is set to true to enable buffered logging.<\/li>\n<li>In this example, <code>buffersize<\/code>is not set. If it is not set, a default buffer size of 8 KB is used.<\/li>\n<\/ul>\n<p>The above configuration will produce an output as specified in the screenshot.<\/p>\n<p><figure id=\"attachment_55787\" aria-describedby=\"caption-attachment-55787\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_buffer.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55787\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_buffer.jpg\" alt=\"\" width=\"820\" height=\"657\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_buffer.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_buffer-300x240.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/log4j_buffer-768x615.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-55787\" class=\"wp-caption-text\">log4j_buffer<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<h2>4. Buffered Logging with buffer size<\/h2>\n<p>In the previous configuration, buffer size was not explicitly configured. Log4j supports defining a buffer size to control buffered logging.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Buffer Size Configuration<\/em><\/span><\/p>\n<pre class=\"brush:xml;highlight:[6,7]\">log4j.rootLogger=WARN, fileLogger\r\nlog4j.appender.fileLogger=org.apache.log4j.FileAppender\r\nlog4j.appender.fileLogger.layout=org.apache.log4j.PatternLayout\r\nlog4j.appender.fileLogger.layout.ConversionPattern=%d [%t] %-5p %m%n\r\nlog4j.appender.fileLogger.File=example.log\r\nlog4j.appender.fileLogger.bufferedIO = true\r\nlog4j.appender.fileLogger.bufferSize = 16\r\n<\/pre>\n<ul>\n<li>In Line 6, buffer capability is enabled.<\/li>\n<li>Line 7 specifies the buffer size. In this configuration, it is set to 16 KB. In our small application, we don&#8217;t see the effects of buffer size setting. But the difference is that logs will be buffered till the buffer size reaches 16KB in the second configuration.<\/li>\n<\/ul>\n<h2>5. Buffer and ImmediateFlush<\/h2>\n<p>In our previous post(<a href=\"http:\/\/examples.javacodegeeks.com\/enterprise-java\/log4j\/log4j-immediateflush-property-example\/\">ImmediateFlush<\/a>), we looked at another way of delayed flushing. If\u00a0<code>bufferedIO<\/code> is enabled, <code>immediateFlush<\/code> is set to false. i.e flushing is delayed and logs are buffered. By default, immediate flush has a buffer size of 1 KB. Now this configuration would be sufficient for most of the applications but for a configurable buffer size,\u00a0<code>bufferedIO<\/code> and <code>bufferedSize<\/code> must be utilized. This allows developers to control the performance parameters of the application.<\/p>\n<p>Buffering has similar disadvantages of <code>immediateFlush<\/code>. The application can crash before the last few lines are buffered to the logging destination. Even in our above example, the application terminates before the logs are written. If we observe during the run, in log file only ~900 log lines will be written. Our application terminates and the last 100 lines are missing in the log file. We need to consider the performance trade-off while disabling the buffer.<\/p>\n<h2>6. 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>Run the application with the configuration specified above.<\/li>\n<\/ol>\n<h2>7. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <b><\/b><b><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/Log4jBufferSizeExample.zip\">Log4jBufferSizeExample<\/a><\/b><\/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":[189,724],"class_list":["post-55684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-log4j","tag-core-java-2","tag-log4j-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Log4j BufferSize 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-buffersize-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Log4j BufferSize 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-buffersize-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-03-05T09:00:52+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=\"5 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-buffersize-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/\"},\"author\":{\"name\":\"Rajagopal ParthaSarathi\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85\"},\"headline\":\"Log4j BufferSize Example\",\"datePublished\":\"2018-03-05T09:00:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/\"},\"wordCount\":773,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\",\"keywords\":[\"core java\",\"log4j\"],\"articleSection\":[\"Log4j\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/\",\"name\":\"Log4j BufferSize Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg\",\"datePublished\":\"2018-03-05T09:00:52+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-buffersize-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-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-buffersize-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 BufferSize 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 BufferSize 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-buffersize-example\/","og_locale":"en_US","og_type":"article","og_title":"Log4j BufferSize 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-buffersize-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-03-05T09:00:52+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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/"},"author":{"name":"Rajagopal ParthaSarathi","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/c3c29bebb942f4a63a6a2d4c38411b85"},"headline":"Log4j BufferSize Example","datePublished":"2018-03-05T09:00:52+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/"},"wordCount":773,"commentCount":1,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","keywords":["core java","log4j"],"articleSection":["Log4j"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/","name":"Log4j BufferSize Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/08\/apache-log4j-logo.jpg","datePublished":"2018-03-05T09:00:52+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-buffersize-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/log4j\/log4j-buffersize-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-buffersize-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 BufferSize 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\/55684","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=55684"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/55684\/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=55684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=55684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=55684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}