trace

System.Net (HttpWebRequest) tracing without using files or app.config?

和自甴很熟 提交于 2019-11-27 01:24:45
问题 I want to capture certain, but not all, HttpWebRequest traffic in my application for debugging purposes. It's a web service hosted by IIS. I have read How to: Configure Network Tracing. This works great, but I don't want to direct the trace to a file, due to possible permission problems on the file system, data sensitivity, etc. I would like to capture directly to a something in-memory that I can subsequently inspect or encrypt and email. Preferably, this would not involve any changes to the

How can I see queries that are executed against Oracle?

那年仲夏 提交于 2019-11-27 00:57:40
问题 I need to see the queries that are being sent to Oracle to execute them. Can someone give me specific detailed instructions on how to do this ? 回答1: If you want to see the queries from a specific user, you can use this (assuming you have privileges to query v$session and v$sqlarea (usually through SELECT_CATALOG_ROLE ) SELECT sess.sid, sess.username, sqla.optimizer_mode, sqla.hash_value, sqla.address, sqla.cpu_time, sqla.elapsed_time, sqla.sql_text FROM v$sqlarea sqla, v$session sess WHERE

How to “debug” Haskell with printfs?

自古美人都是妖i 提交于 2019-11-27 00:45:42
问题 coming from the Ocaml community, I'm trying to learn a bit of Haskell. The transition goes quite well but I'm a bit confused with debugging. I used to put (lots of) "printf" in my ocaml code, to inspect some intermediate values, or as flag to see where the computation exactly failed. Since printf is an IO action, do I have to lift all my haskell code inside the IO monad to be able to this kind of debugging ? Or is there a better way to do this (I really don't want to do it by hand if it can

How can I make Perl and Python print each line of the program being executed?

怎甘沉沦 提交于 2019-11-27 00:27:02
问题 I know that bash -x script.sh will execute script printing each line before actual execution. How to make Perl and Python interpreters do the same? 回答1: Devel::Trace is the Perl analogue, the trace module is Python's. 回答2: Devel::DumpTrace was released in 2011 and has more features than Devel::Trace , such as evaluating variable values in the trace output. 回答3: python -m trace -t main.py Test program: main.py from a import g def f(i): g(i) for i in range(3): f(i) a.py def g(i): print i Output

How to save websocket frames in Chrome

依然范特西╮ 提交于 2019-11-26 22:45:25
问题 I am logging websocket traffic using Chrome/Developer Tools. I have no problem to view the websocket frames in network "Frames" window, but I can not save all frames (content enc. as JSON) in an external (text) file. I have already tried save as HAR and also simply used cntl A,C,V (first "page" copied only) but have so far not been very successful. I am running Linux Mint 17. Do you have hints how this can be done? 回答1: Update for Chrome 63, January 2018 I managed to export them as JSON as

Redirect Trace output to Console

这一生的挚爱 提交于 2019-11-26 22:34:20
问题 Let's say I'm working on a little batch-processing console app in VB.Net. I want to be able to structure the app like this: Sub WorkerMethod() 'Do some work Trace.WriteLine("Work progress") 'Do more work Trace.WriteLine("Another progress update") '... End Sub Sub Main() 'Do any setup, like confirm the user wants to continue or whatever WorkerMethod() End Sub Note that I'm using Trace rather than Console for my output. This is because the worker method may be called from elsewhere, or even

How to define custom TraceListener in app.config

风流意气都作罢 提交于 2019-11-26 22:33:20
问题 I have implemented a custom trace listener (derived from TextWriteTraceListener ) and now I would like to set my application to use it instead of standard TextWriteTraceListener . First I added default TextWriteTraceListener in order to make sure it works ok and it does. Here's my app.config: <configuration> <system.diagnostics> <trace autoflush="true" indentsize="4"> <listeners> <add name="TextListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log" /> <remove

How can I add a Trace() to every method call in C#?

孤人 提交于 2019-11-26 22:32:12
I am having a hard time tracking down a lock issue, so I would like to log every method call's entry and exit. I've done this before with C++ without having to add code to every method. Is this possible with C#? Dennis G. Probably your best bet would be to use an AOP (aspect oriented programming) framework to automatically call tracing code before and after a method execution. A popular choice for AOP and .NET is PostSharp . A profiler is great for looking at your running code during development but if you're looking for the ability to do custom traces in production, then, as Denis G.

How to add (simple) tracing in C#? [closed]

怎甘沉沦 提交于 2019-11-26 22:29:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include: App.config / Web.config stuff to add for registering TraceListeners how to set it up in the

How to find out if a .NET assembly was compiled with the TRACE or DEBUG flag

只谈情不闲聊 提交于 2019-11-26 22:04:01
问题 Is there any way to find out if an assembly has been compiled with the TRACE or DEBUG flag set without modifying the assembly? 回答1: The only best way to do is check the compiled assemblies itself. There is this very useful tool called '.NET Assembly Information' found here by Rotem Bloom. After you install this it asociates .dll files to open with itself. After installing you can just double-click on the Assembly to open with it and it will give you the assembly details as displayed in the