Questions tagged [tracesource]

61 questions
1
vote
1 answer

TraceInformation method call is disabled by compiler

I put a breakpoint to the last line of code. Breakpoint is disabled. Why? It looks like the code is excluded by some condition. The constructor of TraceSource works, and I can verify the object is OK and all listeners are OK. It really looks…
Captain Comic
  • 15,744
  • 43
  • 110
  • 148
1
vote
2 answers

Best practice for using application wide TraceSource

So I have an application where I will be using tracing for logging application activity/errors etc. Most information will go in a log file whereas some errors will go in event viewer too. This application will have lots of classes. What is the best…
imak
  • 6,489
  • 7
  • 50
  • 73
1
vote
0 answers

Finding a TraceSource from code

We have a large business application which contains multiple project all managed by a single management project. within this management project i want to adjust the switch value of certain tracesources remotly and use DebugView to see what is…
1
vote
0 answers

When are System.Diagnostics.Trace calls included in a Visual Studio 2013 build?

In an application built with Visual Studio 2013 I have the TRACE constant unchecked: From my understanding, this is supposed to mean that any call made by a System.Diagnostics.TraceSource object will not be included in the compiled code per…
Tom Regan
  • 3,580
  • 4
  • 42
  • 71
1
vote
2 answers

Can tracing via TraceSource be configured through code from external assembly

Most TraceSource tracing examples show how it is done via configuration. I am trying to achieve this via code. I have a simple assembly as follows: using System; using System.Diagnostics; using System.Threading; namespace TracingLib { public…
deostroll
  • 11,661
  • 21
  • 90
  • 161
1
vote
2 answers

Class based trace sources for System.Diagnostics

I'm currently migrating from log4net as a logging framework to the System.Diagnostics namespace in order to use 1) a .net built-in framework already available and b) use it's powerful features like activity tracing. With log4net, I'm used to request…
xvdiff
  • 2,179
  • 2
  • 24
  • 47
1
vote
0 answers

How can I build a TraceSource listener application?

I could really use a window independent of VS2012, that I can run on my other monitor, to show TraceSource messages as they are written? I realise this complicates things slightly being cross-process, but I'm sure there are many ways of just…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
1 answer

Why create a TraceSource as static?

For all the examples I have seen of people creating a TraceSource for a class, it is always defined as static private static TraceSource traceSource = new TraceSource("TraceSourceApp"); Why do this over private readonly TraceSource _traceSource =…
davros
  • 103
  • 1
  • 6
1
vote
2 answers

Is there any merit in 'Aspect Based Tracing'?

Just to be clear, my meaning of 'aspect' is a horizontal factor of the application's functions, not intercepting all method calls as in Aspect Oriented Programming. I have just discovered the beauty of the .NET Trace infrastructure, and in…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
1 answer

TraceListener to trace WCF events, but not self generated events

Our shop has a TraceListener that send events to a repository via a webservice call. We use it for our own TraceSources, but want to be able to use it for other TraceSources, like System.ServiceModel and System.Activities.
BozoJoe
  • 6,117
  • 4
  • 44
  • 66
1
vote
1 answer

Attaching a trace listener to an existing trace source in app.config

I have created a trace source in my code with a specific name, and then I want to use the section in app.config to attach a listener to it at runtime. Here is my app.config:
WildCrustacean
  • 5,896
  • 2
  • 31
  • 42
0
votes
1 answer

Does Diagnostics.TraceSource support buffered logging?

Does Diagnostics.TraceSource support buffered logging or some other queuing mechanism? I've no doubt come across the plethora of questions on the various logging frameworks. On many of those questions someone chimes in that "I wish people would…
EBarr
  • 11,826
  • 7
  • 63
  • 85
0
votes
1 answer

Trace listener not writing trace information

public sealed class Logger { private static TraceSource myTraceSource; private Logger() { } public static TraceSource Create() { if (myTraceSource == null) return myTraceSource = new…
Rishikesh
  • 486
  • 6
  • 15
0
votes
0 answers

How to capture live running traces from MSO7104B oscilloscope with the help of MATLAB without any delay?

% Create instrument object for Agilent oscilloscope oscilloscope = visa('agilent', 'GPIB0::9::INSTR'); % Change the VISA address as per your oscilloscope configuration % Set communication parameters set(oscilloscope, 'InputBufferSize',…
0
votes
1 answer

Trace to MsTest v2 test log using TraceSource

I have an old application that was coded with tracing done by calling directly new TraceSource("SourceName").TraceInformation(...). Eventually, I want to review this code and define the source as a static private element but for now I have to deal…
bkqc
  • 831
  • 6
  • 25