From 43353eb1dcc22f9ab9dd01a0e3ebe2722c56acd5 Mon Sep 17 00:00:00 2001
From: Ceki Gulcu
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n+ * + *
TTLLLayout has the advantage of faster load time whereas {@link ch.qos.logback.classic.PatternLayout PatternLayout} + * requires roughly 40 milliseconds to load its parser classes. Note that the second run of PatternLayout will be much much faster (approx. 10 micro-seconds).
+ * + *Fixed format layouts such as TTLLLayout should be considered as an alternative to PatternLayout only if the extra 40 milliseconds at application start-up is considered significant.
+ * + * @author Ceki Gülcü + * @since 1.1.6 + */ +public class TTLLLayout extends LayoutBaseIf no such file is found, and the executing JVM has the
-
- ServiceLoader (JDK 6 and above) the ServiceLoader will be used to resolve an
- implementation of
- com.qos.logback.classic.spi.Configurator
.
- The first implementation found will be used.
- See
- ServiceLoader documentation for more details.
+
If no such file is found,
+ service-provider loading facility (introduced in JDK 1.6) is
+ used to resolve the implementation of
+ com.qos.logback.classic.spi.Configurator
+ interface by looking up the file
+ META-INF\services\ch.qos.logback.classic.spi.Configurator
+ in the class path. Its contents should specify the fully
+ qualified class name of the desired Configurator
+ implementation.
+
If none of the above succeeds, logback configures itself @@ -120,21 +124,28 @@ -
The fourth and last step is meant to provide a default (but - very basic) logging functionality in the absence of a +
The last step is meant as last-ditch effort to provide a + default (but very basic) logging functionality in the absence of a configuration file.
If you are using Maven and if you place the - logback-test.xml under the - src/test/resources folder, Maven will ensure that it - won't be included in the artifact produced. Thus, you can use a - different configuration file, namely logback-test.xml - during testing, and another file, namely, logback.xml, in - production. The same principle applies by analogy for Ant. + logback-test.xml under the src/test/resources + folder, Maven will ensure that it won't be included in the + artifact produced. Thus, you can use a different configuration + file, namely logback-test.xml during testing, and another + file, namely, logback.xml, in production.
+Fast start-up It takes about 100
+ miliseconds for Joran to parse a given logback configuration
+ file. To shave off those miliseconds at aplication start up, you
+ can use the service-provider loading facility (item 4 above) to
+ load your own custom Configurator
class with BasicConfigrator
+ serving as a good starting point.
LogbackValve
(in logback-access) now attempts to
+
LogbackValve
(in logback-access) now attempts to
load the configuration file as a resource if it cannot be found on
the filesystem (LOGBACK-1069). This
@@ -63,6 +63,15 @@
by Paulius Matulionis. Analysis of the problem and the relevant PR
was provided by Ferenc Palkovics.
BasicConfigurator.configure
method call executes
+ significatly faster. Improved documentation for configuration
+ using JDK 1.6 service-provider facility. These changes are in
+ response to LOGBACK-1141
+ requesting faster logback start-up time.
+
Fixed issue with variable substitution with the value ending in a colon. This problem was reported in LOGBACK-1140 by -- GitLab