Adding to IIS logging

31 views
Skip to first unread message

vent...@gmail.com

unread,
Apr 24, 2025, 6:59:31 AMApr 24
to Migrated By Firefly
Hi everyone, 

Anyone knows a nice way to add parameters to the IIS log in a POST request?

Thanks!

Noam Honig

unread,
Apr 24, 2025, 7:10:57 AMApr 24
to Migrated By Firefly
Sure - you can easily send information from .NET to appear in the iis logs - including information from post requests and anything else from your code - here's an example on how it looks on my machine:

Here's how you do it.
I have this method in my code:
        public static void AppendToIISLog(string text)
        {
            if (HttpContext.Current?.Request != null)
                HttpContext.Current.Response.AppendToLog(text);
}

And than I simply call it with the data I want:
AppendToIISLog("&something=somevalue")
or:
AppendToIISLog("&prg="+u.GetTextParam("PRGNAME"));


example.png

Moshe Ventura

unread,
Apr 24, 2025, 10:35:18 AMApr 24
to Noam Honig, Migrated By Firefly
So awesome, thank you Noam!

--
You received this message because you are subscribed to the Google Groups "Migrated By Firefly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to migrated-by-fir...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/migrated-by-firefly/77b968a7-a917-40d9-8f5b-491ffa41544en%40googlegroups.com.


--
Moshe Ventura
Partner & CTO | V.Run LTD.
mobile: +972-54-800-2275
email: vent...@gmail.com
Reply all
Reply to author
Forward
0 new messages