Commit Graph

1009 Commits

Author SHA1 Message Date
Phillip Webb
8e114e3e2a Merge branch '1.2.x' 2015-08-03 11:09:40 -07:00
Phillip Webb
2c0ec1b428 Polish 2015-08-03 11:09:33 -07:00
Phillip Webb
199a3c1535 Fix type in DefaultPropertyNamePatternsMatcher 2015-08-03 11:03:48 -07:00
Phillip Webb
891dd5a0f6 Polish 2015-08-03 11:03:48 -07:00
Andy Wilkinson
5c1f700c3a Merge branch '1.2.x' 2015-08-03 16:23:54 +01:00
Andy Wilkinson
838e0ef33e Polish contribution
- Extract the logic that coerces the string into a LogLevel into a
  separate method.
- Add a test that verifies that false is mapped to LogLevel.OFF

Closes gh-3628
2015-08-03 16:23:36 +01:00
shanman190
cbd37b583f Make it easier to use YAML configuration to turn off a logger
A level named off is used to disable logging for a particular logger.
YAML interprets off as false, leading to a failed attempt to get the
LogLevel for FALSE. A workaround is to quote the level, i.e. use "off"
rather than off.

This commit updates LoggingApplicationListener to coerce the string
false back to the level off.

Closes gh-3631
See gh-3628
2015-08-03 16:21:26 +01:00
Stephane Nicoll
fac04c1228 Add test
#3386 was actually fixed as part of #2387. Add the test that used to
reproduce the issue.
2015-08-03 15:03:19 +02:00
Stephane Nicoll
cd53297fed Add missing logging.pattern meta-data
See gh-3405
2015-08-03 09:22:30 +02:00
Andy Wilkinson
255764f1a0 Ensure that custom Liquibase logger is always used
Liquibase 3.4.0 contains a bug that causes the initialization of its
ServiceLocator to pollute its map of loggers with a DefaultLogger for
the logger named "liquibase". Liquibase 3.4.1 contains a change that
improves the situation, but does not address is completely. Creating a
CustomResolverServiceLocator, as we do, still causes the map of
loggers to be polluted due to logging that's performed in
ClassLoaderResourceAccessor.getResourcesAsStream.

The commit address the problem by upgrading to Liquibase 3.4.1 and
adding the package containing our custom logger to the default service
locator before we register our custom service locator. This ensures
that the logging that's performed during the creation of our custom
service locator will still use our custom logger.

Closes gh-3470
Closes gh-3616
2015-07-29 10:15:29 +01:00
izeye
ee6fc8d917 Fix typos
Closes gh-3608
2015-07-28 08:54:47 +02:00
Stephane Nicoll
42e230192f Polish 2015-07-24 07:19:53 +02:00
Stephane Nicoll
4596844b90 Merge branch '1.2.x' 2015-07-23 11:37:29 +02:00
Stephane Nicoll
fbfbec1177 Use custom validator on supported classes only
Previously, a customer was set regardless of the fact that it is
supported on the target bean. DataBinder has an actual assertion check
that would fail in such a case.

We now associate the custom validator only if it supports the target
bean.

Fixes gh-3581
2015-07-23 11:37:01 +02:00
Andy Wilkinson
ea85e0d0b0 Merge branch '1.2.x' 2015-07-22 17:55:17 +01:00
Andy Wilkinson
a43cd18ac9 Avoid changing root logger level when setting level of unconfigured logger
Previously getLoggerConfig(loggerName) was used to retrieve the
LoggerConfig object on which the level was to be set. As described in the
method’s javadoc it will “remove tokens from the package name as
necessary or return the root LoggerConfig if no other matches were found”.
This is problematic as, if there’s no configuration for the logger whose
level is being configured, the level will be applied to a logger from an
outer package or to the root logger.

This commit updates Log4J2LoggingSystem to use the configuration’s map of
LoggerConfigs, rather than calling getLoggerConfig. In the event of the
level being set on an unconfigured logger, this will produce a null
LoggerConfig. When a null LoggerConfig is encountered, a new one is
created with the appropriate level. If the config already exists, its
level is set as it was before.

The code that was accessing the root logger using a magic null value
(which was then coerced into the root logger’s name (an empty string))
has also been updated to make it clearer that they are purposefully
dealing with the root logger.

Closes gh-3550
2015-07-22 17:50:07 +01:00
Phillip Webb
6f6f898739 Polish 2015-07-20 10:22:10 -07:00
Dave Syer
c181a2d157 Add simple performance test for properties binding 2015-07-20 13:09:23 +01:00
Lucas Saldanha
1fc66b434e Polish JsonParserFactory javadoc
Closes gh-3545
2015-07-19 08:54:28 +02:00
Phillip Webb
e9d252e05c Add @DeprecatedConfigurationProperties annotation
Add a new @DeprecatedConfigurationProperties annotation which can be
used by the `ConfigurationMetadataAnnotationProcessor` to generating
meta-data deprecated blocks.

Fixes gh-3543
2015-07-17 14:14:37 -07:00
Phillip Webb
08d1f6daf5 Allow persistent servlet sessions across restarts
Update Tomcat, Jetty and Undertow to serialize session data when the
application is stopped and load it again when the application restarts.

Persistent session are opt-in; either by setting `persistentSession`
on the ConfigurableEmbeddedServletContainer or by using the property
`server.session.persistent=true`.

Fixes gh-2490
2015-07-16 17:29:20 -07:00
Phillip Webb
3e72300bd4 Add application specific temp folder support
Add ApplicationTemp class which can be used to obtain a temp folder
based on the running application. Allows restarted application to
find temp files saved in a previous run.

Fixes gh-3529
2015-07-16 17:29:12 -07:00
Eddú Meléndez
125de0211b Support multiple names in <springProfile> Logback element
Closes gh-3493
Closes gh-3494
2015-07-16 17:29:02 +01:00
Stephane Nicoll
d9939a5be2 Map FATAL level for Log4j
Make sure that Boot's FATAL level is mapped to log4j and log4j2 properly.

Fixes gh-3518
2015-07-16 17:59:04 +02:00
izeye
8d3803b826 Polish LoggingSystem
Closes gh-3512
2015-07-16 09:20:20 +02:00
izeye
f4589e7cc3 Fix typos
Closes gh-3504
2015-07-15 15:45:02 +02:00
Stephane Nicoll
e52c190b05 Narrow String properties to a more precise type
We envision that IDE will support auto-completion for known types in the
future, for instance Charset, MimeType, Resource and Locale. Some of our
own configuration keys use a raw String type whereas they actually
represent a higher-level concept.

We now make sure to expose these with a better type, if applicable.

Closes gh-2898
2015-07-14 15:19:15 +02:00
Phillip Webb
73be2c056f Clear logback status list on reset
Update LogbackLoggingSystem to clear logback status messages on reset.
This prevents shutdown errors from preventing subsequent startup.

Fixes gh-3472
2015-07-13 13:22:51 -07:00
Phillip Webb
fd6024ebf1 Move and refactor Redis test server @Rule
Move the Redis JUnit @Rule so that it can be used with
SessionAutoConfigurationTests. Also refactored the internals a little.
2015-07-13 11:52:42 -07:00
xueyu
534eb29bde Fix typo
Closes gh-3467
2015-07-13 09:53:14 +02:00
Ivan Sopov
5f25080091 Add HTTP compression excludeUserAgents property
Closes gh-3363
2015-07-10 16:31:55 -07:00
Rob Baily
177ea459f1 Support log pattern properties with logback
Update AbstractLoggingSystem to pass LoggingInitializationContext to
loadDefaults() method to enable access to the environment.
DefaultLogbackConfiguration now uses this to find log pattern overrides.

Fixes gh-3367
Closes gh-3405
2015-07-10 15:23:46 -07:00
Stephane Nicoll
1ce418cfdc Fix meta-data for logging.level property 2015-07-10 18:12:24 +02:00
Stephane Nicoll
f6f74e1aef Polish 2015-07-10 10:48:47 +02:00
Phillip Webb
8280004f80 Fix ClasspathLoggingApplicationListener order
Commit 3de25164 inadvertently caused early debug logging from the
ClasspathLoggingApplicationListener. We now set its order relative
to the LoggingApplicationListener.

See gh-2543
2015-07-09 16:51:19 -07:00
Stephane Nicoll
cf1c0cd04c Polish 2015-07-09 14:57:45 +02:00
Stephane Nicoll
97634e85ac Remove unnecessary keyword 2015-07-09 14:33:01 +02:00
Phillip Webb
582239b03b Add ApplicationArguments and ApplicationRunner
Add ApplicationArguments interface which allows SpringApplication.run
arguments to be injected into any bean. The interface provides access
to both the raw String[] arguments and also provides some convenience
methods to access the parsed 'option' and 'non-option' arguments.

A new ApplicationRunner interface has also been added which is
similar to the existing CommandLineRunner.

Fixes gh-1990
2015-07-08 23:27:13 -07:00
Phillip Webb
3de2516452 Tweak LoggingApplicationListener order
Provide additional space between the ConfigFileApplicationListener order
and the LoggingApplicationListener order.

Fixes gh-2543
2015-07-08 14:38:20 -07:00
Andy Wilkinson
9cb2a09680 Reinstate output of stack trace accidentally removed in 66d4a2a 2015-07-08 22:04:11 +01:00
Andy Wilkinson
66d4a2a49e Ignore Azure’s default LOGGING_CONFIG env var when initialising logging
When using Tomcat, Azure automatically configures an environment
variable called LOGGING_CONFIG that configures the
java.util.logging.config.file system property.
LoggingApplicationListener finds this configuration via the Spring
environment (it looks for logging.config) and attempts to use it as the
name of the logging configuration file. Since c3d93f7 this failure
causes the app to fail to start, rather than the previous behaviour of
silently falling back to the default configuration.

This commit updates LoggingApplicationListener to only consider
configuration that is a non-empty string and that does not start with
-Djava.util.logging.config.file=, which is the beginning of the default
configuration on Azure, and is very unlikely to be part of the name of a
logging configuration file.

Closes gh-3366
2015-07-08 21:58:54 +01:00
izeye
dd77ab90a0 Fix typo
Closes gh-3428
2015-07-07 04:45:48 +02:00
JamieFarrelly
205f6d92e7 Clarify MultipartConfigFactory javadoc
Update MultipartConfigFactory javadoc to make it clear that you are
passing in the size in bytes.

Fixes gh-3414
2015-07-06 13:55:35 -07:00
Phillip Webb
155f04ef30 Switch ConfigFileAppListener to use DeferredLog
Update ConfigFileApplicationListener to use the recently introduced
DeferredLog class rather than storing its own log messages.
2015-07-06 13:14:33 -07:00
Stephane Nicoll
afd357f45a Reduce ConfigFileApplicationListener logs
Previously, all attempts to log a configuration file were logged at DEBUG
level which lead to a lot of noise as Spring Boot looks in many places by
default.

We now only log the files that are effectively found at DEBUG level and
all failed attempts at TRACE level.

Closes gh-3129
2015-07-06 18:05:36 +02:00
Dave Syer
067c7a295c Extra logging detail if file is empty 2015-07-06 16:47:57 +01:00
Stephane Nicoll
774474f8b7 Add hint providers for core properties
Closes gh-3322
2015-07-06 11:57:32 +02:00
Phillip Webb
ca56fbbcf0 Fix malformed RandomValuePropertySource javadoc
See gh-3391
2015-07-05 23:10:34 -07:00
Matt Benson
36d36f97bd Improve RandomValuePropertySource
Rework RandomValuePropertySource class javadoc, particularly the
description of the `random.int` range suffix.

Also add support for range based random longs.

Fixes gh-3391
2015-07-05 23:00:40 -07:00
Phillip Webb
35379f627a Polish 2015-07-05 22:34:36 -07:00