Commit Graph

3283 Commits

Author SHA1 Message Date
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
Phillip Webb
d17b7c8195 Polish 2014-10-29 12:08:37 -07:00
Andy Wilkinson
466ed469eb Merge branch '1.1.x' 2014-10-29 17:52:30 +00:00
Andy Wilkinson
e2dd659dd1 Include condition's location (class or method name) in message
Closes gh-1787
2014-10-29 17:51:17 +00:00
Andy Wilkinson
c8d7a6dc24 Merge branch '1.1.x' 2014-10-29 17:47:28 +00:00
Andy Wilkinson
9a491013c3 Update email addresses in pom files to use new pivotal.io domain
Closes gh-1774
2014-10-29 17:47:13 +00:00
Andy Wilkinson
8a1e010d0a Allow multiple templateLoaderPaths to be configured for FreeMarker
Closes gh-1767
2014-10-29 17:42:48 +00:00
Andy Wilkinson
ef2455938e Align new JavaMail dependencies with Spring IO Platform
Spring IO Platform already provides dependency management for JavaMail.
This commit updates Boot’s new JavaMail dependency management to align
with the Platform, thereby allowing the Platform to inherit Boot’s
dependency management instead of defining its own.
2014-10-29 17:05:48 +00:00
Stephane Nicoll
429da743f5 Add missing close 2014-10-29 15:44:53 +01:00
Stephane Nicoll
ccc5e65779 Add email support
This commit adds a new starter to auto-configure a MailSender when the
necessary classes are present and when the property "spring.mail.host" is
set.

The auto-configuration also accepts any arbitrary properties that
JavaMail might need using the "spring.mail.properties" prefix.

Fixes gh-1760
2014-10-29 15:39:05 +01:00
Dave Syer
6ed2c65852 More testing of context hierarchy creation
There actually isn't anything much we can (or should) change here. Spring always
copies PropertySources and profiles down into the child context when you set its parent.
That seems sensible. So you can add a new profile in a child context but it will always
"inherit" from its parent.

See gh-1776
2014-10-29 12:31:07 +00:00
Stephane Nicoll
1709e79cb6 Merge pull request #1763 from sdeleuze/whitelabel-typo
* whitelabel-typo:
  Fix a typo in error.whitelabel.enabled
2014-10-29 08:56:56 +01:00
Sebastien Deleuze
7546f10aad Fix a typo in error.whitelabel.enabled 2014-10-29 08:56:12 +01:00
Andy Wilkinson
741d1f7273 Merge branch '1.1.x'
Conflicts:
	spring-boot-dependencies/pom.xml
2014-10-28 19:15:58 +00:00
Andy Wilkinson
812acec48f Upgrade to Spring Batch 3.0.2.RELEASE
Closes gh-1782
2014-10-28 19:14:34 +00:00
Andy Wilkinson
b1e7cd0be2 Rename spring-boot-starter-cloud in spring-boot-dependencies
Fixes #1781
2014-10-28 19:08:43 +00:00
Andy Wilkinson
15a3a21417 Ignore JUL logging tests that only fail on Bamboo 2014-10-28 17:18:44 +00:00
Dave Syer
af2a867d14 Remove missing module from pom (thanks Eclipse) 2014-10-28 16:14:45 +00:00
Andy Wilkinson
d71afe0918 Remove redundant reference to renamed spring-boot-starter-cloud module 2014-10-28 16:13:26 +00:00
Dave Syer
e2f2099197 Add test for gh-1776 2014-10-28 16:12:14 +00:00
Dave Syer
b95e6fce6b Add 'Connectors' to project name 2014-10-28 16:11:45 +00:00
Dave Syer
7fa372555b Add @SuppressWarnings('serial') 2014-10-28 15:57:49 +00:00
Dave Syer
015377f9de Exclude log4j in a couple of places (see gh-1660)
also rename spring-cloud starter
2014-10-28 15:57:14 +00:00
Andy Wilkinson
0b116a1a5a Increase the level of JUL logging calls in the tests to try to fix CI
The CI build is failing, but, for some reason, the same tests are
working fine on developer machines. This commit increases the level
at which the logging calls are being made to severe in the hope that
some CI-specific configuration is filtering out the calls when
they're at info level.
2014-10-28 15:54:17 +00:00
Christian Dupuis
6c66ff78c0 Fix health status aggregation bug 2014-10-28 15:47:27 +01:00
Andy Wilkinson
cebfd44d16 Upgrade to Spring AMQP 1.4.0.RC1 2014-10-28 13:49:52 +00:00
Andy Wilkinson
bd562c06b6 Merge branch '1.1.x' 2014-10-28 11:06:23 +00:00
Andy Wilkinson
f58b8366e1 Correct the syntax that's used for smart single and double quotes
Fixes gh-1753
2014-10-28 11:03:35 +00:00
Dave Syer
aec38566ea Simplify logic for locating default logging config
Fixes gh-1612, Fixes gh-1770
2014-10-28 09:57:53 +00:00
David Liu
11c1e5ed6b add for log4j2 2014-10-28 09:57:53 +00:00
David Liu
f9566ed30f spring-boot-1612: make console and file output configurable
1 disable the file output unless LOG_FILE is set
2 make the console optional

fixes: gh-1612
2014-10-28 09:57:53 +00:00
Andy Wilkinson
ba40f13370 Update expectation to match response from anonymous access to /health 2014-10-28 09:39:40 +00:00
Dave Syer
1c4650f3ce Add Gitter badge 2014-10-28 08:27:01 +00:00
Dave Syer
9fce630c86 Extract lists in VCAP_APPLICATION (e.g. uris)
Fixes gh-1773
2014-10-28 08:14:00 +00:00
Dave Syer
6c3d490c74 Add note about springloaded configuration 2014-10-27 17:22:35 +00:00
Dave Syer
24e71e868f Allow /health and /info to authenticate anonymously
Then we can optionally find a non-anonymous principal if there
is one. If the user is anonymous then the health result is cached
up to endpoints.health.ttl (default 1000ms) to prevent a DOS attack.

Fixes gh-1353
2014-10-27 16:58:01 +00:00
Andy Wilkinson
43eda4ce5d Upgrade to Spring Integration 4.1.0.RC1
Closes gh-1765
2014-10-27 15:07:23 +00:00
Dave Syer
f39d4978c3 Fix tests for JSON error rendering
See gh-1762
2014-10-27 15:06:32 +00:00
Dave Syer
4cd3bf18e0 Revert "Updated liquibase dependency to 3.2."
This reverts commit d6621e62ad. I think
the test failure might be a bug in Liquibase:
https://liquibase.jira.com/browse/CORE-2094
2014-10-27 14:43:00 +00:00
Nathan Voxland
d6621e62ad Updated liquibase dependency to 3.2.
Fixes gh-1382
2014-10-27 11:49:33 +00:00
Dave Syer
576f5cfb06 Upgrade Jersey to 2.13
Fixes gh-1752
2014-10-27 11:09:02 +00:00
Dave Syer
254ab55476 Re-arrange priority of error message 2014-10-27 11:08:53 +00:00
Dave Syer
7bac7370c8 Use request attribute if available for error message
Fixes gh-1762, gh-1731
2014-10-27 10:50:10 +00:00
Dave Syer
e8b59b9e55 Add CLI command line arguments examples 2014-10-27 08:11:53 +00:00
Stephane Nicoll
e858cfcced Add missing starters in documentation 2014-10-24 13:58:15 +02:00
Domingo Suarez Torres
73c2862901 Add Jade4J Starter to the starters README
Closes gh-1748
Closes gh-1703
2014-10-23 10:39:58 +01:00
Andy Wilkinson
a54c75bb9d Merge branch '1.1.x' 2014-10-22 13:44:39 +01:00
Andy Wilkinson
ae503c62d2 Upgrade to 2.1.11 of the Git commit Maven plugin
Closes gh-1708
2014-10-22 13:33:48 +01:00
Andy Wilkinson
cf0018e88c Merge branch '1.1.x' 2014-10-22 12:42:10 +01:00
Andy Wilkinson
5e5e707945 Upgrade to Reactor 1.1.5.RELEASE
Closes gh-1742
2014-10-22 12:38:55 +01:00