spring-boot/spring-boot-samples
Phillip Webb cf24af0bfb Rework logging to prevent double initialization
Prior to this commit LoggingSystem initialization would happen multiple
times. Once to configure "quiet" logging, and again to configure correct
settings once the Application was initialized. This could cause problems
if `logging.groovy` logback files were used.

The logging system is now only initialized once (when possible) by
following these steps:

- Standard logging initialization occurs via the actual logging
  implementation used (e.g. logback will load a logback.xml file if it
  exists)
- beforeInitization() is called to prevent early log output.
  Implementations now either use a Filter or simply set the root logging
  level.
- initialize() is called with an optional log configuration file (e.g
  a custom logback.xml location) and an optional log output file (the
  default is null indicating console only output).

The initialize() method will attempt to prevent double initialization
by checking if a standard configuration file exists. Double
initialization now only occurs in the following situations:

- The user has a standard configuration file (e.g. classpath:logback.xml)
  but also specifies a logging.config property. Double initialization is
  required since the specified configuration file supersedes the default.
- The user has a standard configuration file (e.g. classpath:logback.xml)
  and specifies a logging.file property. Double initialization is
  required since the standard configuration may use a ${LOG_FILE}
  reference.

In addition this commit removes the `logging.console` option and now
assumes that logging either occurs only to console or to both the
console and a file. This restriction helps simplify the LoggingSystem
implementations. If file only logging is required a custom logback.xml
can be used.

Fixes gh-1091
See gh-1612, gh-1770
2014-10-30 00:13:13 -07:00
..
spring-boot-sample-actuator Polish 2014-10-29 12:08:37 -07:00
spring-boot-sample-actuator-log4j Rework logging to prevent double initialization 2014-10-30 00:13:13 -07:00
spring-boot-sample-actuator-log4j2 Rework logging to prevent double initialization 2014-10-30 00:13:13 -07:00
spring-boot-sample-actuator-noweb Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-actuator-ui Update expectation to match response from anonymous access to /health 2014-10-28 09:39:40 +00:00
spring-boot-sample-amqp Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-aop Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-batch Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-data-elasticsearch Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-data-gemfire Merge branch '1.1.x' 2014-10-15 16:36:11 +01:00
spring-boot-sample-data-jpa Add org.hibernate.SQL to the --debug logger levels 2014-10-13 17:53:48 +01:00
spring-boot-sample-data-mongodb Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-data-redis Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-data-rest Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-data-solr Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-flyway Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-hornetq Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-integration Merge branch '1.1.x' 2014-10-20 11:20:56 +01:00
spring-boot-sample-jersey Polish 2014-10-06 12:03:51 -07:00
spring-boot-sample-jersey1 Polish 2014-10-06 12:03:51 -07:00
spring-boot-sample-jetty Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-jta-atomikos Fix Windows Atomikos/Bitronix ApplicationTests 2014-09-01 17:46:52 -07:00
spring-boot-sample-jta-bitronix Support mixed XA/non-XA ConnectionFactory beans 2014-09-02 13:00:59 -07:00
spring-boot-sample-jta-jndi Remove workaround for SPR-12118 2014-09-03 18:32:17 -07:00
spring-boot-sample-liquibase Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-parent-context Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-profile Fixup version numbers following release 2014-10-10 15:53:54 -07:00
spring-boot-sample-secure Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-servlet Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-simple Fixup version numbers following release 2014-10-10 15:53:54 -07:00
spring-boot-sample-tomcat Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-tomcat8-jsp Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-tomcat-multi-connectors Switch master to 1.2.0.BUILD-SNAPSHOT 2014-07-11 10:44:05 +02:00
spring-boot-sample-tomcat-ssl Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-traditional Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-velocity Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-freemarker Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-groovy-templates Merge branch '1.1.x' 2014-07-23 15:57:53 +01:00
spring-boot-sample-web-jsp Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-method-security Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-secure Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-secure-custom Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-secure-jdbc Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-web-static Fixup version numbers following release 2014-10-10 15:53:54 -07:00
spring-boot-sample-web-ui Fixup version numbers following release 2014-10-10 15:53:54 -07:00
spring-boot-sample-web-velocity Switch master to 1.2.0.BUILD-SNAPSHOT 2014-07-11 10:44:05 +02:00
spring-boot-sample-websocket Polish 2014-10-21 20:34:00 -07:00
spring-boot-sample-ws Next development version 2014-10-10 15:19:47 -07:00
spring-boot-sample-xml Next development version 2014-10-10 15:19:47 -07:00
pom.xml Next development version 2014-10-10 15:19:47 -07:00
README.adoc Fix broken documentation links 2014-09-25 09:47:07 -07:00

 The following java samples are provided:

* link:spring-boot-sample-simple[spring-boot-sample-simple]
  -- A simple command line application
* link:spring-boot-sample-tomcat[spring-boot-sample-tomcat]
  --  Embedded Tomcat
* link:spring-boot-sample-jetty[spring-boot-sample-jetty]
  -- Embedded Jetty
* link:spring-boot-sample-actuator[spring-boot-sample-actuator]
  -- Simple REST service with production features
* link:spring-boot-sample-actuator-ui[spring-boot-sample-actuator-ui]
  -- A web UI example with production features
* link:spring-boot-sample-actuator-noweb[spring-boot-sample-actuator-noweb]
  -- A production features sample with no web application
* link:spring-boot-sample-actuator-log4j[spring-boot-sample-actuator-log4j]
  -- A production features sample using log4j for logging (instead of logback)
* link:spring-boot-sample-web-ui[spring-boot-sample-web-ui]
  -- A thymeleaf web application
* link:spring-boot-sample-web-static[spring-boot-sample-web-static]
  -- A web application serving static files
* link:spring-boot-sample-web-freemarker[spring-boot-sample-web-freemarker]
  -- A web application using Freemarker templates
* link:spring-boot-sample-web-velocity[spring-boot-sample-web-velocity]
  -- A web application using Velocity templates
* link:spring-boot-sample-web-groovy-templates[spring-boot-sample-web-groovy-templates]
  -- A web application using native Groovy templates
* link:spring-boot-sample-web-jsp[spring-boot-sample-web-jsp]
  -- A web application using JSP templates
* link:spring-boot-sample-web-tomcat8-jsp[spring-boot-sample-tomcat8-jsp]
  -- A web application using JSP templates with Tomcat 8
* link:spring-boot-sample-web-tomcat-multi-connectors[spring-boot-sample-tomcat-multi-connectors]
  -- A web application using multiple connectors in tomcat, showing how to customize the Tomcat server
* link:spring-boot-sample-web-secure[spring-boot-sample-web-secure]
  -- A web application with typical Security configuration enabling a login form
* link:spring-boot-sample-web-method-security[spring-boot-sample-web-method-security]
  -- A web application with Security configuration enabling global method security
* link:spring-boot-sample-secure[spring-boot-sample-secure]
  -- example showing Spring Security in a non-web application
* link:spring-boot-sample-servlet[spring-boot-sample-servlet]
  -- example showing a "raw" `Servlet` returning plaintext content
* link:spring-boot-sample-ws[spring-boot-sample-ws]
  -- A simple contract-first SOAP web service with Spring Web Services
* link:spring-boot-sample-websocket[spring-boot-sample-websocket]
  -- A web application with Websocket support on the client and server
* link:spring-boot-sample-flyway[spring-boot-sample-flyway]
  -- Example showing database migrations with Flyway
* link:spring-boot-sample-liquibase[spring-boot-sample-liquibase]
  -- Example showing database migrations with Liquibase
* link:spring-boot-sample-amqp[spring-boot-sample-amqp]
  -- Example showing message-oriented application using RabbitMQ
* link:spring-boot-sample-hornetq[spring-boot-sample-hornetq]
  -- Example showing message-oriented application using HornetQ
* link:spring-boot-sample-batch[spring-boot-sample-batch]
  -- Define and run a Batch job in a few lines of code
* link:spring-boot-sample-data-jpa[spring-boot-sample-data-jpa]
  -- Spring Data JPA + Hibernate + HSQLDB
* link:spring-boot-sample-data-mongodb[spring-boot-sample-data-mongodb]
  -- Spring Data Mongo repositories
* link:spring-boot-sample-data-solr[spring-boot-sample-data-solr]
  -- Spring Data Solr repositories
* link:spring-boot-sample-data-redis[spring-boot-sample-data-redis]
  -- Simple usage of Spring Data Redis
* link:spring-boot-sample-data-rest[spring-boot-sample-data-rest]
  -- Crud repositories exposed as REST endpoints
* link:spring-boot-sample-integration[spring-boot-sample-integration]
  -- A spring integration application
* link:spring-boot-sample-profile[spring-boot-sample-profile]
  -- example showing Spring's `@profile` support
* link:spring-boot-sample-parent-context[spring-boot-sample-parent-context]
  -- example showing an `ApplicationContext` with a parent
* link:spring-boot-sample-aop[spring-boot-sample-aop]
  -- shows explicit usage of Spring AOP
* link:spring-boot-sample-traditional[spring-boot-sample-traditional]
  -- shows more traditional WAR packaging  (but also executable using `java -jar`)
* link:spring-boot-sample-xml[spring-boot-sample-xml]
  -- Example show how Spring Boot can be mixed with traditional XML configuration (we
  generally recommend using Java `@Configuration` whenever possible)