vy commented on code in PR #2424:
URL: https://github.com/apache/logging-log4j2/pull/2424#discussion_r1543694204
##########
log4j-api/src/main/java/org/apache/logging/log4j/util/SystemPropertiesPropertySource.java:
##########
@@ -32,19 +34,32 @@
@ServiceProvider(value = PropertySource.class, resolution =
Resolution.OPTIONAL)
public class SystemPropertiesPropertySource implements PropertySource {
+ private static final Logger LOGGER = StatusLogger.getLogger();
private static final int DEFAULT_PRIORITY = 0;
private static final String PREFIX = "log4j2.";
+ private static final PropertySource INSTANCE = new
SystemPropertiesPropertySource();
+
/**
- * Used by bootstrap code to get system properties without loading
PropertiesUtil.
+ * Method used by Java 9+ to instantiate providers
+ * @since 2.24.0
+ * @see java.util.ServiceLoader
*/
+ public static PropertySource provider() {
+ return INSTANCE;
+ }
Review Comment:
> A provider method is a public static method named "provider" with no
formal parameters and a return type that is assignable to the service's
interface or class.
States [the Java 9 `ServiceLoader`
javadoc](https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/util/ServiceLoader.html).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]