orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Use e.g. extension methods on config to make it more obvious

Open danielwertheim opened this issue 8 years ago • 2 comments

Was trying to find good info about configuration, e.g. on how to turn trace logging and statistics off. Found this: http://dotnet.github.io/orleans/Documentation/Deployment-and-Operations/Configuration-Guide/Client-Configuration.html

Which says:

//TraceFilePattern = "false", // Set it to false or none to disable file tracing, effectively it sets config.Defaults.TraceFileName = null;

That is not really obvious. Could be simplified with a simple extension method or something:

config.DisableFileTracing();

When it comes to statistics, I'm not sure if it's enough to do StatisticsWriteLogStatisticsToTable = false or if you have to assign TimeSpan.FromMilliseconds(-1) (weird that TimeSpan.Zero isn't accepted) to some of the intervals. Could also be something like:

config.DisableStatistics();

danielwertheim avatar Jan 07 '18 10:01 danielwertheim

Hi @danielwertheim Great suggestion. Our old API is not great at being intuitive. We are trying to make them more intuitive , as part of orleans 2.0 effort.

For tracing, Orleans 2.0 adopted Microsoft.Extension.Logging abstraction and replaced our old tracing/logging infra with it. So in 2.0, ITraceConfiguration, which includes TraceFilePattern , is replaced by MEL abstraction. So we recommend to configure tracing in Microsoft.Extension.Logging way. Please see our documentation on how logging looks like in 2.0 and how to migrate to it. Let me know if the new way address your concern.

For statistic provider and its configuration, we are replacing its configuration classes and methods with ASP.Net IOption and IConfiguration system. That part of work is still under development by @jason-bragg . I will include him in the loop, and make sure he hears your concern.

But in summary, the API for tracing and statistic provider configuration are changing a lot in orleans 2.0. The old legacy configuration classes are either removed or deprecated and we don't intend to improve legacy configuration class in general. And I think the direction orleans 2.0 is going can address your concern. Please let me know if you have further concern.

xiazen avatar Jan 09 '18 20:01 xiazen

close this for now, welcome to reopen it if you have more question

xiazen avatar Jan 19 '18 23:01 xiazen