<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>devkuma – Logback</title>
    <link>https://www.devkuma.com/en/tags/logback/</link>
    <image>
      <url>https://www.devkuma.com/en/tags/logback/logo/180x180.jpg</url>
      <title>Logback</title>
      <link>https://www.devkuma.com/en/tags/logback/</link>
    </image>
    <description>Recent content in Logback on devkuma</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>kc@example.com (kc kim)</managingEditor>
    <webMaster>kc@example.com (kc kim)</webMaster>
    <copyright>The devkuma</copyright>
    
	  <atom:link href="https://www.devkuma.com/en/tags/logback/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Logback</title>
      <link>https://www.devkuma.com/en/docs/logback/</link>
      <pubDate>Wed, 30 Nov 2022 09:56:00 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/logback/</guid>
      <description>
        
        
        &lt;h2 id=&#34;logback-overview&#34;&gt;Logback Overview&lt;/h2&gt;
&lt;p&gt;Logback was designed by &lt;a href=&#34;https://github.com/ceki&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ceki Gülcü&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;, the creator of log4j, with the goal of becoming the successor project to log4j.&lt;/p&gt;
&lt;p&gt;Based on 10 years of experience designing robust logging systems, Logback is faster than existing logging systems and uses fewer resources.&lt;/p&gt;
&lt;p&gt;Logback also provides unique convenience features that other logging systems do not have.&lt;/p&gt;
&lt;p&gt;Currently, Logback is divided into three modules: logback-core, logback-classic, and logback-access.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The logback-core module is the foundation for the other two modules.&lt;/li&gt;
&lt;li&gt;The logback-classic module can absorb the functionality of log4j 1.x in a greatly improved form.&lt;/li&gt;
&lt;li&gt;The logback-access module integrates with servlet containers such as Tomcat and Jetty and provides HTTP access logging.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;main-features-of-logback&#34;&gt;Main Features of Logback&lt;/h2&gt;
&lt;p&gt;The main features are as follows.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;High speed and reduced memory usage
&lt;ul&gt;
&lt;li&gt;Based on log4j 1.x, certain critical execution paths have been rewritten to run about 10 times faster, while memory usage has also been reduced.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Versatility
&lt;ul&gt;
&lt;li&gt;Because logback-classic natively implements the SLF4J API, it is easy to switch between Logback and other logging frameworks such as log4j 1.x or &lt;code&gt;java.util.logging&lt;/code&gt; (JUL).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Flexibility
&lt;ul&gt;
&lt;li&gt;Logback configuration can be written with scripts expressed in programmatic, XML, or Groovy formats. Existing log4j users can also convert a &lt;code&gt;log4j.properties&lt;/code&gt; file to &lt;code&gt;logback.xml&lt;/code&gt; by using a web application. In addition, because configuration files support conditional processing, a single configuration file can properly target various environments such as development, test, and production.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Extensive filtering features
&lt;ul&gt;
&lt;li&gt;Logback includes more extensive filtering features than those provided by log4j 1.x. For example, only users who are identifying a problem can be set to debug level, while other users continue logging at warning level.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;performance-comparison-of-logback-log4j-and-log4j2&#34;&gt;Performance Comparison of Logback, Log4j, and Log4j2&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Unit: ops/ms&lt;/em&gt;&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;Threads&lt;/th&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;log4j sync&lt;/th&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;log4j async&lt;/th&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;log4j2 sync&lt;/th&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;log4j2 async&lt;/th&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;Logback 1.3.0 sync&lt;/th&gt;
          &lt;th style=&#34;text-align: right&#34;&gt;Logback 1.3.0 async&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;987.08&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;745.34&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;884.33&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;844.67&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;2,139.83&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,760.30&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;2&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;542.27&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;716.09&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,220.76&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;819.40&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;2,276.77&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,821.36&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;4&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;639.86&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;676.35&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,406.60&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;770.27&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,836.99&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,799.39&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;8&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;633.13&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;726.21&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,257.63&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;733.25&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,787.62&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,774.99&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;16&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;585.13&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;693.74&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,211.31&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;722.34&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,813.09&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,815.10&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;32&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;643.85&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;657.08&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,203.27&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;704.08&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,782.81&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,751.21&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;64&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;576.67&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;696.21&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,236.37&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;726.15&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,740.27&lt;/td&gt;
          &lt;td style=&#34;text-align: right&#34;&gt;1,644.81&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;main-logback-functions&#34;&gt;Main Logback Functions&lt;/h2&gt;
&lt;p&gt;The main functions are as follows.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Logger: specifies how logs are output&lt;/li&gt;
&lt;li&gt;Appender: specifies where logs are output&lt;/li&gt;
&lt;li&gt;Layout: specifies the log output format&lt;/li&gt;
&lt;li&gt;Filter: filters logs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;libraries-that-provide-similar-features-to-logback&#34;&gt;Libraries That Provide Similar Features to Logback&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Apache Log4j&lt;/li&gt;
&lt;li&gt;java.util.logging (JUL)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;logback-logging-levels&#34;&gt;Logback Logging Levels&lt;/h2&gt;
&lt;p&gt;Logback provides five standard log levels.&lt;/p&gt;
&lt;p&gt;The levels are assumed to be ordered as shown below.&lt;/p&gt;
&lt;p&gt;TRACE &amp;lt; DEBUG &amp;lt; INFO &amp;lt; WARN &amp;lt; ERROR&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Level&lt;/th&gt;
          &lt;th&gt;Description&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;TRACE&lt;/td&gt;
          &lt;td&gt;Informational events with very low importance&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;DEBUG&lt;/td&gt;
          &lt;td&gt;Informational events with low severity&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;INFO&lt;/td&gt;
          &lt;td&gt;Events that indicate overall progress&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;WARN&lt;/td&gt;
          &lt;td&gt;Events that indicate potentially harmful situations&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;ERROR&lt;/td&gt;
          &lt;td&gt;Error events, regardless of whether they are fatal&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;logback-operating-environment&#34;&gt;Logback Operating Environment&lt;/h2&gt;
&lt;p&gt;The required operating environment is as follows.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Server OS&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Follows the operating environment of the Java Runtime Environment (JRE)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Other operating environment details&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Logback version 1.3.x or later requires Java 9 for builds. However, it can run on Java 8 or later.&lt;/li&gt;
&lt;li&gt;Logback version 1.2.x requires Java 6.x.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;logback-license&#34;&gt;Logback License&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Logback can be redistributed under the Eclipse Public License v1.0 or the Lesser General Public License version 2.1.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Logback official site
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://logback.qos.ch/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://logback.qos.ch/&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Logback download page
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://logback.qos.ch/download.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://logback.qos.ch/download.html&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Logback source repository
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/qos-ch/logback&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://github.com/qos-ch/logback&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Logback official documentation
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://logback.qos.ch/documentation.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://logback.qos.ch/documentation.html&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Logback announcements page
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://logback.qos.ch/news.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://logback.qos.ch/news.html&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
      
      <category>Java</category>
      
      <category>Logback</category>
      
    </item>
    
  </channel>
</rss>
