Commit Graph

119 Commits

Author SHA1 Message Date
Vladimir Tsanev
632d78b6fb Prettify Log4J 2's default output
This commit updates the default output produced when using Log2J 2 to
be similar to the output produced by Logback. It introduces a new
converter for throwables that adds some whitespace around stacktraces
and a color converter that produces ANSI-colored output when enabled
via spring.output.ansi.enabled.

Closes gh-3548
2015-08-05 15:09:27 +01:00
Spring Buildmaster
7ce391db4f Next development version 2015-07-01 22:48:01 -07:00
Spring Buildmaster
5d81c87b43 Next Development Version 2015-06-04 00:49:11 -07:00
Alexander Heusingfeld
04776232f7 Allow auto-reload of log4j2 config
Log4j2 can auto-reload its configuration file as long as the reference
to a `java.io.File` is provided in the `ConfigurationSource`. Previously,
we always created such `ConfigurationSource` with only the URL regardless
of its type.

Detect when the configuration URL points to a File and create the
`ConfigurationSource` accordingly.

The `spring-boot-sample-actuator-log4j2` has been updated to reload the
logging configuration every 30 sec if necessary.

Fixes gh-3024, gh-3030
2015-05-28 11:24:25 +02:00
Spring Buildmaster
e03c11dda8 Next development version 2015-03-30 22:56:20 -07:00
Phillip Webb
0174476ff1 Merge branch '1.1.x' into 1.2.x 2015-03-02 12:12:57 -08:00
Phillip Webb
50e1f80581 Remove .factorypath files 2015-03-02 12:12:06 -08:00
Phillip Webb
561ed99b5b Merge branch '1.1.x' into 1.2.x 2015-03-02 12:09:24 -08:00
Phillip Webb
a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 2015-02-26 17:01:02 -08:00
Spring Buildmaster
8f0ad02237 Next development version 2015-02-26 15:26:53 -08:00
Phillip Webb
8a49218e82 Fixup version numbers following release 2015-02-26 14:17:25 -08:00
Spring Buildmaster
60725cd8bd Next development version 2015-01-07 23:37:07 -08:00
Phillip Webb
8fd99bde8b Update samples to use specific log configuration 2014-12-17 11:33:29 -08:00
Spring Buildmaster
1a788c1741 Next development version 2014-12-10 16:35:50 -08:00
Phillip Webb
a641f0c72a Polish 2014-11-18 15:45:14 -08:00
Phillip Webb
d039f43107 Update samples to use @SpringBootApplication
Update the relevant samples to use the new @SpringBootApplication
annotation.

Closes gh-1842
2014-11-06 22:51:09 -08:00
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
4c51aa8e28 Polish 2014-10-08 11:34:11 -07:00
Daniel Fullarton
1dbc94d0f7 Add a logging system, starter and sample for Log4j 2
Closes gh-1565
2014-10-08 15:30:00 +01:00