[Mono-aspnet-list] Program Trace in mono

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Tue Jun 16 18:34:29 EDT 2009


On Tue, 2009-06-16 at 02:17 -0700, ChristinaP wrote:
> Hi,
> 
> Can anyone help with program tracing in mono...
> for example... I have a sample helloworld .NET application loaded in
> /srv/www/htdocs/... the file structure is like this:
> /srv/www/htdocs/ - contains
> 1) a folder called "HelloBrowser"
> 2) The "HelloBrowser" folder contains a directory "bin" and an ASP file
> "HelloBrowser.aspx"
> 3) The "bin" folder contains "HelloBrowser.dll"
> 
> When I access the HelloBrowser.aspx, it internally calls HelloBrowser.dll
> and then returns a string "hello, world" to the browser output.
> HelloBrowser.dll is the executable from a C++ code HelloBrowser.aspx.cs.

I guess you mean C#...

> Now when this page is executed, is there a way I can see the program trace
> on the server... I tried checking the program trace in
> /var/log/apache2/access_log, but this does not show the HelloBrowser.dll
> being called... it only shows HelloBrowser.aspx ... so I am concluding that
> this access_log shows only the calls between browser client and the server.
> The internal program calls within the web server code are not captured here.
> My query is whether there is a tool to capture a complete program trace and
> how to use it.

There are several ways to obtain trace output:
        -Anything you write to Console.Error will be in the apache
        error_log
        -You can use System.Diagnostics.TraceListener and friends to
        send the trace output wherever you want
        -If you want to trace ASP.NET events, there's @Page Trace="True"
        and/or Trace.axd
        -If you want to get the trace generated fro 'mono --trace', I
        would recommend restricting by assembly or namespace (see
        mono(1)) and adding those options via 'MonoSetEnv
        MONO_OPTIONS=--trace=blahblah' to your mod_mono.conf
        
-Gonzalo




More information about the Mono-aspnet-list mailing list