Commit Graph

28 Commits

Author SHA1 Message Date
John Blum
7e9dca80bb Fixup spring-geode-starter-logging tests based on Spring Boot 2.7 logging (SLF4J, Logback) configuration. 2022-10-24 11:03:18 -07:00
John Blum
78b2a02c36 Refactor the spring-geode-starter-logging module. 2022-10-24 09:21:22 -07:00
John Blum
7422af0746 Integrate Spring Geode Logging with Spring Boot Logging and externalizes configuration.
* Deprecates the logback-include.xml file.
* Declare the logging context name as 'geodeLoggingContext'.
* Determines whether Spring Boot SLF4J Logback logging configuration (metadata) files are present on the application classpath.
* Applies custom logging configuration declared by the user in the spring-geode-logging.properties file on the application classpath.
* Conditionally includes SLF4J Logback logging configuration from Spring Boot.
* Includes Appenders, Loggers and Properties configuration metadata files from Spring Geode Starter Logging.

Resolves #117.
2022-07-07 11:13:09 -07:00
John Blum
b0f83ea9a2 Enable Spring Geode Logging configuration to be declared by the user in a spring-geode-logging.properties file on the Spring Boot application classpath.
Resolves #117.
2022-07-07 11:11:34 -07:00
John Blum
d93c93f36d Refactor and encapsulate Properties, Logger and Appender SLF4J Logback configuration (metadata) in separate includes (XML files) on the application classpath.
Resolves #117.
2022-07-07 11:10:37 -07:00
John Blum
e5183d886f Declare 'org.codehaus.janino:janino' as an implementation dependency in Spring Geode Starter Logging.
This enables the SLF4J Logback configuration files to include conditional logic, such as if-then-else statements.

Resolves #117.
2022-07-07 11:07:50 -07:00
John Blum
b9cbffcaf6 Update Copyright for 2022. 2022-03-02 15:52:27 -08:00
John Blum
20b8c2d172 Cleanup all unsafe and unchecked compiler warnings. 2020-07-23 14:57:01 -07:00
John Blum
8447eaad10 Update Copyright to 2020. 2020-02-19 23:04:23 -08:00
John Blum
ce295d235f Add method to resolve an Appender from a Logger by name and type.
Add Javadoc to the addAppender(:Logger, :Appender) method.

Refactor addAppender(..) method to lookup the added (registered) Appender from the Logger as verification that the Appender was successfully added.

Re-arrange private utility methods.

Resolves gh-73.
2020-02-19 19:18:08 -08:00
John Blum
f5918498c9 Add CompositeAppender.compose(:Appender[]) and CompositeAppender.compose(:Iterable<Appender>) methods to compose an array or Iterable of Appenders.
Resolves gh-73.
2020-02-19 19:12:18 -08:00
John Blum
7fe4c41fc9 Add StringAppender.Builder.applyTo(:org.slf4j.Logger) method.
Resolves gh-73.
2020-02-19 19:10:32 -08:00
John Blum
06a1add71b Add utility method to reset the initialized, dirty state of the SLF4J, Logback logging provider/system.
Resolves gh-73.
2020-02-19 19:07:56 -08:00
John Blum
ab03a7c3c1 Change internally created StringBuffer and StringBuilder StringAppenderWrapper implementations used by the StringAppender from Singletons to Prototypes.
Fixes bug in StringAppender that maintained stale Log messages in the buffers of the wrappers between tests.

Resolves gh-73.
2020-02-19 19:07:56 -08:00
John Blum
007e4db373 Add Function-based converter to convert from SLF4J Loggers to Logback Loggers.
Resolves gh-73.
2020-02-14 15:19:14 -08:00
John Blum
348d981b3a Add newlines to separate log events/messages appended to the String.
Resolves gh-73.
2020-02-13 00:11:50 -08:00
John Blum
e4613a1fcc Change 'spring-geode-starter-test' from a testRuntime dependency to testCompile.
Resolves gh-73.
2020-02-12 08:45:54 -08:00
John Blum
4d84136f01 Add LogbackSupport class to invoke the SLF4J and Logback APIs.
Resolves gh-73.
2020-02-12 08:38:57 -08:00
John Blum
5cabe1662d Add StringAppender Logback Appender implementation to capture log messages in-memory appended to a String.
Resolve gh-73.
2020-02-12 08:14:02 -08:00
John Blum
bbe8ff65e0 Add CompositeAppender Logback Appender implementation to compose multiple Appenders as a single Appender.
Resolve gh-73.
2020-02-12 08:14:02 -08:00
John Blum
99cff21c17 Add default name for DelegatingAppender.
Resolves gh-73.
2020-02-11 19:25:04 -08:00
John Blum
a87194cb87 Change IllegalStateException message in AbstractLoggingIntegrationTests.configureLogging() method to properly reflect intent.
Call TestAppender.stop() in addition to clear() in the test tearDown() method.

Resolves gh-73.
2020-02-10 20:23:30 -08:00
John Blum
278ce513c0 Set (as default) root Logger log level to 'INFO'.
Resolves gh-73.
2020-02-10 20:23:25 -08:00
John Blum
0002534140 Add Unit and Integration Tests for the 'spring-geode-starter-logging' module log configuration and logging provider (i.e. SLF4J/Logback) extensions.
Resolves gh-73.
2020-02-10 20:23:19 -08:00
John Blum
85d630c34e Refactor the 'spring-geode-starter-logging' module provided logback.xml file to use templates (includes).
Moved the declared Appenders and Loggers from logback.xml to a new logback-include.xml file making it easier to compose Logback (XML) configuration files using templates, or includes.  This is particularly useful during Integration Testing where logback-test.xml files can be composed with different templates/includes.

Resolves gh-73.
2020-02-10 20:23:13 -08:00
John Blum
269b60bdc6 Provide DelegatingAppender class to allow SLF4J logging provider Appenders to be injected [programmatically] at configuration/runtime.
This is very useful in Integration Tests where the test class needs to assert log statements in infrastructure, system, framework or application code.

Resolves gh-73.
2020-02-10 20:23:07 -08:00
John Blum
0e3ac202a7 Explicitly declare Logback as the logging provider.
Add the 'spring-geode-starter-test' module as a testRuntime dependency in order to write Unit and Integration Tests for this 'spring-geode-starter-logging' module.

Resolves gh-73.
2020-02-10 20:23:02 -08:00
John Blum
c023a22455 Add new 'spring-geode-starter-logging' and 'spring-gemfire-starter-logging' modules.
The new modules enable logging output to be rendered for both Apache Geode & Pivotal GemFire given the right configuration now that the SDG @EnableLogging annotaiton is effectively deprecated since the corresponding GemFire/Geode properties (i.e. gemfire.log-level) no longer have any effect.

Resolves gh-73.
2020-02-10 20:22:56 -08:00