orleans icon indicating copy to clipboard operation
orleans copied to clipboard

orleans client in mvc5 How to enable logging

Open noobwu opened this issue 9 years ago • 8 comments

orleans client in mvc5 How to enable logging

noobwu avatar Sep 25 '17 02:09 noobwu

I have this problem, too :(

Qoooooooooooo avatar Sep 25 '17 09:09 Qoooooooooooo

which version of Orleans are you using?

xiazen avatar Sep 28 '17 17:09 xiazen

@xiazen 1.5.1

Qoooooooooooo avatar Sep 30 '17 03:09 Qoooooooooooo

How are you configuring your client?

ronMilne avatar Oct 02 '17 00:10 ronMilne

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.

xiazen avatar Oct 02 '17 18:10 xiazen

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);

noobwu avatar Oct 03 '17 16:10 noobwu

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.

xiazen avatar Oct 03 '17 17:10 xiazen

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

Qoooooooooooo avatar Oct 09 '17 05:10 Qoooooooooooo