The PR modifies AdapterCore so that it accepts an ILoggerFactory instead of an ILogger. The ILoggerFactory is wrapped in a ScopedLoggerFactory, which sets a scope on every logger that it creates containing the ID of the adapter. Among other things,
this is to allow log messages from the adapter and from any helper classes (such as SnapshotTagValueManager) to be easily identified using the logging scope.
AdapterCore.ILogger is now deprecated with a note saying to use the LoggerFactory property instead.
AdapterBase<T> provides new constructors that accept ILoggerFactory instead of ILogger; the constructors that use ILogger are still available but have been marked as deprecated.
Built-in concrete adapter types have been modified to accept ILoggerFactory parameters instead of ILogger<T>.
Helper classes that previously accepted plain ILogger instances now require either an ILogger<T> or an ILoggerFactory.
The adapter host project template has been updated to use Serilog as the logging abstractions implementation.
This PR contains breaking changes.
The PR modifies
AdapterCore
so that it accepts anILoggerFactory
instead of anILogger
. TheILoggerFactory
is wrapped in aScopedLoggerFactory
, which sets a scope on every logger that it creates containing the ID of the adapter. Among other things, this is to allow log messages from the adapter and from any helper classes (such asSnapshotTagValueManager
) to be easily identified using the logging scope.AdapterCore.ILogger
is now deprecated with a note saying to use theLoggerFactory
property instead.AdapterBase<T>
provides new constructors that acceptILoggerFactory
instead ofILogger
; the constructors that useILogger
are still available but have been marked as deprecated.Built-in concrete adapter types have been modified to accept
ILoggerFactory
parameters instead ofILogger<T>
.Helper classes that previously accepted plain
ILogger
instances now require either anILogger<T>
or anILoggerFactory
.The adapter host project template has been updated to use Serilog as the logging abstractions implementation.