Skip to content

Commit 810ca03

Browse files
committed
docs: migrate Fiddler Classic loggin article
1 parent 70122e4 commit 810ca03

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Lgging in Fiddler Application
3+
description: Configure Fiddler Classic to log specific data with FiddlerScript
4+
slug: fiddler-logging-fiddlerscript
5+
publish: true
6+
position: 35
7+
---
8+
9+
10+
Fiddler Classic provides a lightweight Logging mechanism.
11+
12+
From FiddlerScript, you can do this:
13+
14+
```c#
15+
FiddlerObject.log("Your message here");
16+
```
17+
18+
19+
From a Fiddler extension, do this:
20+
```c#
21+
FiddlerApplication.Log.LogString("Your message here");
22+
```
23+
24+
If you want to get copies of log messages, write the following code in your extension:
25+
26+
```c#
27+
FiddlerApplication.Log.OnLogString += new EventHandler<LogEventArgs>(YourEventHandler);
28+
```
29+
30+
and implement an event handler to capture log events. Because logging may occur from background threads, you should use Invoke or BeginInvoke to marshal any UI updates to the UI thread:
31+
```c#
32+
public delegate void LogAString(string Str);
33+
34+
void YourEventHandler(object sender, LogEventArgs e)
35+
{
36+
FiddlerApplication.UI.BeginInvoke(new LogAString(LogOnMainThread), new object[] { e.LogString });
37+
}
38+
39+
void LogOnMainThread(string sMsg]
40+
{
41+
oLogUI.txtLog.AppendText(String.Format("{0} {1} \r\n", DateTime.Now.ToString("HH:mm:ss:ffff"), sMsg));
42+
}
43+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy