trace

How to trace code execution in PHP?

蓝咒 提交于 2019-11-30 06:41:24
I would like to see a log of THE WHOLE code execution of PHP script(s). Something like this: http://en.wikibooks.org/wiki/Ruby_Programming/Standard_Library/Tracer (for lack of better example; no flame please). Is there some way how to obtain the log in PHP? Note: I know I can use a debugger but that's not the same. Xdebug is definitely what you want, but with something like callgrind from the valgrind suite as well. Zend blog post here should give you some pointers: http://devzone.zend.com/1139/profiling-php-applications-with-xdebug/ phptrace is an awesome tool to trace php code executions In

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

久未见 提交于 2019-11-30 05:39:40
问题 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

Formatting trace output

蓝咒 提交于 2019-11-30 04:58:46
I'm using TextWriterTraceListener to log diagnostics messages to a text file. However I wan't also to log a timestamp of every trace message added. Is it possible to define a kind of formatter for the listener that would automatically add timestamps? Currently I'm adding timestamps manually on every Trace.WriteLine() call but this isn't very comfortable. Jon Skeet I suggest you use Log4Net instead, which has a lot more customizability. Alternatively you could write your own TraceListener implementation which put the timestamps on for you. You may even be able just derive from

How to trace every method called

我的梦境 提交于 2019-11-30 04:50:24
I have an existing project where I would like to find out all calls being made and maybe dump into a log file. I had a look at this thread , but didnt help much. I tried PostSharp, and the example shows how to achieve it. But I need to add an attribute to every darn method. Being an existing project, with in-numerous methods that is not a feasible option. Is there any other means by which I can quickly trace all calls made? You can do this with Unity Interception See this article for a sample . The article uses attributes, but my code sample below use the dependency injection system (coding to

.NET Tracing: What is the “Default” listener?

女生的网名这么多〃 提交于 2019-11-30 01:02:06
问题 Every example of tracing in .NET people remove the " Default " listener: <configuration> <system.diagnostics> <sources> <source name="TraceSourceApp" switchName="SourceSwitch" switchType="System.Diagnostics.SourceSwitch"> <listeners> <add name="ConsoleListener"/> <add name="ETWListener"/> <remove name="Default"/> </listeners> What is the Default listener, and why is it there by default? A Microsoft guy did benchmarks of the overhead with different listeners: Default |=========================

Tracing versus Logging and how does log4net fit in?

六眼飞鱼酱① 提交于 2019-11-29 23:11:28
I am wondering about what the difference between logging and tracing is. Is the difference basically that tracing is more detailed log giving developers a tool to debug applications at runtime? I have been experimenting with log4net and doing logging. Now I am wondering if I should be doing tracing as well and if I could/should use log4net for that purpose. Should I be doing tracing with log4net and is there some trace level for log4net loggers? Should I use a different log level for debug and trace purposes or is it ok to use the same? Can you give a simple example on how I would do logging

What expressions are allowed in tracepoints?

北城余情 提交于 2019-11-29 23:10:18
When creating a tracepoint in Visual Studio (right-click the breakpoint and choose "When Hit..."), the dialog has this text, emphasis mine: You can include the value of a variable or other expression in the message by placing it in curly braces... What expressions are allowed? Microsoft's documentation is rather sparse on the exact details of what is and is not allowed. Most of the below was found by trial and error in the Immediate window. Note that this list is for C++, as that's what I code in. I believe in C#, some of the prohibited items below are actually allowed. Most basic expressions

How to get Javascript Function Calls/Trace at Runtime

℡╲_俬逩灬. 提交于 2019-11-29 21:20:55
As I interact with my AJAX based application at RUNTIME I'd like the console to spit out all the functions it's calling. (so no stack trace, or breakpoints, or profiling or anything) So for example, let's say I pressed a button on the page. I'd like for it to return all the functions it went through when that happened: So I'd see in the console something like (when I pressed a button): 1. button1Clicked(); 2. calculating(); 3. printingResults(); Which basically means that button1Clicked() called calculating() which called printingResults() Is there a utility, or plugin, browser, or maybe some

How to monitor MySQL query errors, timeouts and logon attempts? [closed]

心不动则不痛 提交于 2019-11-29 20:37:24
问题 While setting up a third party closed source CMS (Sitefinity) the setup doesn't create all tables and procedures necessary to run it. The software lacks a logging system itself and it made me wonder: could I trace and monitor failing SQL statements from MySQL? This serves more than only the purpose of solving my issue with Sitefinity. More often I wonder what's send to the MySQL server, not wanting to dive into the software products or setup a debugging environment etc. I tried JetProfiler

Tracing methods execution time

左心房为你撑大大i 提交于 2019-11-29 18:15:10
问题 I am trying to "inject" custom tracing methods in my application. I want to make it as elegant as possible, without modifying to much of the existing code, and have the possibility to enable / disable it easily. One solution i could think of would be to create a custom Attribute which i will attach it to the methods i want to trace. Basic idea: public class MethodSnifferAttribute : Attribute { private Stopwatch sw = null; public void BeforeExecution() { sw = new Stopwatch(); sw.Start(); }