Class DefaultPlatform
- java.lang.Object
-
- com.google.common.flogger.backend.Platform
-
- com.google.common.flogger.backend.system.DefaultPlatform
-
public class DefaultPlatform extends com.google.common.flogger.backend.PlatformThe default fluent logger platform for a server-side Java environment. The default platform implements the following behavior:- It generates
SimpleLoggerBackendlogger backends. - It uses a default clock implementation (only millisecond precision until Java 8).
- It does not provide support for injecting additional metadata into log statements.
- It determines call site information via stack analysis.
This class is designed to allow configuration via system properties. Each aspect of the platform is configured by providing the name of a static method, in the form
"<package>.<class>#<method>", which returns an instance of the appropriate type. The namespace for system properties is:flogger.backend_factory: Provides an instance ofcom.google.common.flogger.backend.system.BackendFactory.flogger.logging_context: Provides an instance ofcom.google.common.flogger.context.ContextDataProvider.flogger.clock: Provides an instance ofcom.google.common.flogger.backend.system.Clock.
Note that if the
com.google.flogger:flogger-grpc-contextis also available and the value of theflogger.logging_contextsystem property is"com.google.common.flogger.grpc.GrpcContextDataProvider#getInstance"then a gRPC based implementation of theScopedLoggingContextAPI will be used. - It generates
-
-
Constructor Summary
Constructors Constructor Description DefaultPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.common.flogger.backend.LoggerBackendgetBackendImpl(java.lang.String className)protected com.google.common.flogger.backend.Platform.LogCallerFindergetCallerFinderImpl()protected java.lang.StringgetConfigInfoImpl()protected com.google.common.flogger.context.ContextDataProvidergetContextDataProviderImpl()protected longgetCurrentTimeNanosImpl()
-
-
-
Method Detail
-
getCallerFinderImpl
protected com.google.common.flogger.backend.Platform.LogCallerFinder getCallerFinderImpl()
- Specified by:
getCallerFinderImplin classcom.google.common.flogger.backend.Platform
-
getBackendImpl
protected com.google.common.flogger.backend.LoggerBackend getBackendImpl(java.lang.String className)
- Specified by:
getBackendImplin classcom.google.common.flogger.backend.Platform
-
getContextDataProviderImpl
protected com.google.common.flogger.context.ContextDataProvider getContextDataProviderImpl()
- Overrides:
getContextDataProviderImplin classcom.google.common.flogger.backend.Platform
-
getCurrentTimeNanosImpl
protected long getCurrentTimeNanosImpl()
- Overrides:
getCurrentTimeNanosImplin classcom.google.common.flogger.backend.Platform
-
getConfigInfoImpl
protected java.lang.String getConfigInfoImpl()
- Specified by:
getConfigInfoImplin classcom.google.common.flogger.backend.Platform
-
-