Class LogEmitterProviderHolder
java.lang.Object
io.opentelemetry.instrumentation.api.appender.internal.LogEmitterProviderHolder
This class is internal and is hence not for public use. Its APIs are unstable and can change at
any time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Returns the registeredLogEmitterProvider.voidUnsets theLogEmitterProvider.voidset(LogEmitterProvider logEmitterProvider) Sets theLogEmitterProviderthat should be the instance.
-
Constructor Details
-
LogEmitterProviderHolder
public LogEmitterProviderHolder()
-
-
Method Details
-
get
Returns the registeredLogEmitterProvider. -
set
Sets theLogEmitterProviderthat should be the instance. Future calls toget()will return the providedLogEmitterProviderinstance. This should be called once as early as possible in your application initialization logic, often in astaticblock in your main class. It should only be called once - an attempt to call it a second time will result in an error. If trying to set the instanceLogEmitterProvidermultiple times in tests, useresetForTest()between them. -
resetForTest
public void resetForTest()Unsets theLogEmitterProvider. This is only meant to be used from tests which need to reconfigureLogEmitterProvider.
-