trace

Automatically log System.diagnostics.trace messages to an Nlog target

元气小坏坏 提交于 2019-12-01 03:40:38
Say you have C# trace messages all over an application. Something like: Trace.TraceInformation("Service Started"); How do you automatically log this to an nLog target without having to add code like the following to all the classes that have trace messages? using NLog; private static Logger logger = LogManager.GetCurrentClassLogger(); Is there a way to do this without including traces produced by the .NET Framework itself, which this article demonstrates how to do? This works for cases where there isn't an explicit source <system.diagnostics> <trace autoflush="true" indentsize="4"> <listeners>

Can I enable tracing in OWIN?

混江龙づ霸主 提交于 2019-12-01 03:12:26
I have an environmental problem somewhere in OWIN and I want to get some information about what is happening. I have read that I can enable tracing but can't find much information on how to do it. I have added the following to my web.config but no joy. Is this possible? <!-- 1. Enable the switch here. Without this, you get nothing. By default, Katana has "new SourceSwitch("Microsoft.Owin")" at the root level. --> <switches> <add name="Microsoft.Owin" value="Verbose" /> </switches> <!-- 2. Add your shared listeners. --> <trace autoflush="true" /> <sharedListeners> <add name="file" type="System

Running Android systrace on device

只愿长相守 提交于 2019-12-01 00:25:58
I'm unable to run the Android SDK tool called systrace.pl because I get errors like: error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory And indeed the /sys/kernel/debug/tracing directory doesn't even exist. A little research showed I need to enable debugfs with the following command: mount -o rw,remount -t debugfs none /sys/kernel/debug Running mount there afterwards indicates the debugfs is running: #mount ... /sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0 ... And I have trace enabled (all items) in the developer settings menu. I'm using the

Is logging Android systrace events directly from native code possible, without JNI?

北慕城南 提交于 2019-12-01 00:24:58
The Android systrace logging system is fantastic, but it only works in the Java portion of the code, through Trace.beginSection() and Trace.endSection() . In a C/C++ NDK (native) portion of the code it can only be used through JNI, which is slow or unavailable in threads without a Java environment... Is there any way of either adding events to the main systrace trace buffer, or even generating a separate log, from native C code? This older question mentions atrace/ftrace as being the internal system Android's systrace uses. Can this be tapped into (easily)? BONUS TWIST: Since tracing calls

can't understand .net 2010 tracing and app.config

半世苍凉 提交于 2019-11-30 21:24:17
In my app.config I want to set 3 tracing levels (switches?): verbose, warning and none. In the debug version of the code, I want the verbose switch to be active, in the release I want warning. In special cases my application users can modify the config file to disable all traces. I want debug traces to output on the console, while release traces only to a log file. I',ve written the following: [...] <system.diagnostics> <sources> <!-- This section defines the logging configuration for My.Application.Log --> <source name="debug" switchName="debug"> <listeners> <add name="FileLog"/> <add name=

Running Android systrace on device

拜拜、爱过 提交于 2019-11-30 20:23:38
问题 I'm unable to run the Android SDK tool called systrace.pl because I get errors like: error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory And indeed the /sys/kernel/debug/tracing directory doesn't even exist. A little research showed I need to enable debugfs with the following command: mount -o rw,remount -t debugfs none /sys/kernel/debug Running mount there afterwards indicates the debugfs is running: #mount ... /sys/kernel/debug /sys/kernel/debug debugfs rw

Is logging Android systrace events directly from native code possible, without JNI?

耗尽温柔 提交于 2019-11-30 18:14:40
问题 The Android systrace logging system is fantastic, but it only works in the Java portion of the code, through Trace.beginSection() and Trace.endSection() . In a C/C++ NDK (native) portion of the code it can only be used through JNI, which is slow or unavailable in threads without a Java environment... Is there any way of either adding events to the main systrace trace buffer, or even generating a separate log, from native C code? This older question mentions atrace/ftrace as being the internal

WCF tracing in code does not follow MessageLogging settings

房东的猫 提交于 2019-11-30 16:02:07
问题 I need to use WCF tracing in my application but it needs to be controlled from code as much as possible. IT was suggested that I install the following sections in my app.config file: <configuration> <system.serviceModel> <diagnostics> <messageLogging maxMessagesToLog="100" logEntireMessage="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logMessagesAtTransportLevel="true"> </messageLogging> </diagnostics> </system.serviceModel> <system.diagnostics> <sources> <source name=

WCF tracing in code does not follow MessageLogging settings

☆樱花仙子☆ 提交于 2019-11-30 15:44:19
I need to use WCF tracing in my application but it needs to be controlled from code as much as possible. IT was suggested that I install the following sections in my app.config file: <configuration> <system.serviceModel> <diagnostics> <messageLogging maxMessagesToLog="100" logEntireMessage="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logMessagesAtTransportLevel="true"> </messageLogging> </diagnostics> </system.serviceModel> <system.diagnostics> <sources> <source name="System.ServiceModel" > <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="dummy"/> <

wcf trying to set up tracing to debug, not writing to log file

∥☆過路亽.° 提交于 2019-11-30 14:50:29
问题 here's my web.config, running a WCF service in an application on IIS7, but nothing is being written to the specified file. permission on the file has been granted for everyone. <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing, error, warning, critical" propagateActivity="true"> <listeners> <add name="traceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\log\tracestext.log" /> </listeners> </source> <