orleans client in mvc5 How to enable logging
orleans client in mvc5 How to enable logging
I have this problem, too :(
which version of Orleans are you using?
@xiazen 1.5.1
How are you configuring your client?
If you are configuring your client through xml config, then you can configure logging through xml. an example below:
<Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{2}-{1}.log" WriteMessagingTraces="false">
<TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
<TraceLevelOverride LogPrefix="AssemblyLoader.Client" TraceLevel="Warning" />
</Tracing>
If you are configuring your client programmatically, then you can configure logging through ClientConfiguration by modifying its trace related properties.
I use github master version,use NLog.Extensions.Logging, an example below: GrainClient.ConfigureLoggingDelegate = logBuilder => { logBuilder.AddNLog(); NLogConfigureExtensions.ConfigureNLog(HostingEnvironment.MapPath("~/App_Data/Configs/NLog.config")); }; GrainClient.Initialize(config);
are you just playing around with master? In master everything is migrated to MEL technically, except for some remaining tasks needed to be finished, see #3303. In master version, you can configure through ISiloHostBuilder, ICientBuilder, both of which have ConfigureLogging extension methods on them. You can configure through GrainClient.ConfigureLoggingDelegate like in your example.
config example:
<Tracing DefaultTraceLevel="Warning" TraceToConsole="true" TraceToFile="../_OrleansLog/{0}-{1}.log" PropagateActivityId="false" BulkMessageLimit="1000">
<TraceLevelOverride LogPrefix="Runtime" TraceLevel="Warning" />
<TraceLevelOverride LogPrefix="Application" TraceLevel="Warning" />
<TraceLevelOverride LogPrefix="AssemblyLoader" TraceLevel="Warning" />
</Tracing>
only .Net Framework Web Project's _OrleansLog folder has not log files.
but, .Net Core Web Project's _OrleansLog folder has log files, and .Net Framework console application Project's _OrleansLog folder has log files.
@xiazen