Orleans logging has been an old feature with us through the cold and muddy early days. It was introduced as a way to pipe Orleans runtime logging to external log consumers and also an ability to configure multiple ILogConsumer to the system. But now Net.Core team has released something equivalent and better to .Net Standard eco system: Microsoft.Extensions.Logging. So we decided to migrate to it in Orleans 2.0.
It provides the common wrapper which everyone has to write if they want to configure their application with multiple types of loggers. This wrapper provides one set of APIs that are then forwarded to a provider of your choosing. Net.Core team developed a set of built-in providers and also collaborated with various logging framework teams (including third parties like NLog, Serilog, Loggr, Log4Net and more) so that there are Microsoft.Extensions.Logging compatible providers from them, too. To know more, please see this and this.
Microsoft.Extensions.Logging abstraction doesn't completely cover all Orleans logging features. So some feature will be replaced by Microsoft.Extensions.Logging, some will be deprecated, and some will be removed in 2.0. Here is the current plan:
Remove in 2.0
SiloControl. SiloControlReplaced by Microsoft.Extensions.Logging in 2.0
Orleans.Runtime.LogManager, as the configuration component, will be replaced by its counterpart in Microsoft.Extensions.Logging, which is ILoggerFactory (Completed in #3333)Orleans.Runtime.LoggerType, which brings the ability to define your logger type, will be covered by Log filteringDeprecated features in 2.0
Orleans.Runtime.ILogConsumerOrleans.Runtime.Severity, including its configuration part. Orleans.Runtime.Logger, its extension methods, and Logger GetLogger(string) methods from runtime and grain base class. We plan to release an extension package to support the deprecated logging features in a way which is compatible with Microsoft.Extensions.Logging. PR #3284 is an prototype for it.
Message bulking feature, which provides the ability to only log error code count if the same error code has appeared too many times in an interval, will be continuing supported in a Microsoft.Extensions.Logging compatible way, thanks to its ability to bring performance gain. See PR #3284 for more information.
In short, Microsoft.Extensions.Logging will be integrated into Orleans as its suggested logging solution in 2.0. Most orleans logging infra will be replaced by it. Features which Orleans logging currently supports, but not supported in Microsoft.Extensions.Logging will either be deprecated or removed.
Let me know if you have any concerns.
This is part of "Reorganize Orleans packages and project structure" #3353 effort
Excellent! With 2.0 TP4 - successfully integrated single-homed logging from an ASP.Net Core project fronting an Orleans host.
that's awesome ! it actually worked !
mind my bad joke. ofc we tested it before we release. ;)
Well I hope it is reassuring that there are strange people who monitor this type of thing and try stuff out on your random builds!
We should be done with this one.
Most helpful comment
that's awesome ! it actually worked !
mind my bad joke. ofc we tested it before we release. ;)