Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
61 lines (54 loc) · 1.85 KB

File metadata and controls

61 lines (54 loc) · 1.85 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Web;
using NLog.Web.Targets.Wrappers;
namespace NLog.Web
{
/// <summary>
/// ASP.NET HttpModule that enables NLog to hook BeginRequest and EndRequest events easily.
/// </summary>
/// <seealso href="https://github.com/NLog/NLog/wiki/AspNetBufferingWrapper-target">Documentation on NLog Wiki</seealso>
[Obsolete("Replaced by NLogBufferingTargetWrapperModule for AspNetBufferingWrapper support. Marked obsolete with NLog 6.0")]
public class NLogHttpModule : IHttpModule
{
/// <summary>
/// Event to be raised at the end of each HTTP Request.
/// </summary>
public static event EventHandler? EndRequest;
/// <summary>
/// Event to be raised at the beginning of each HTTP Request.
/// </summary>
public static event EventHandler? BeginRequest;
/// <summary>
/// Notify the wrapper target that the correct IHttpModule is installed
/// </summary>
public NLogHttpModule()
{
AspNetBufferingTargetWrapper.MiddlewareInstalled = true;
}
/// <summary>
/// Initializes the HttpModule.
/// </summary>
/// <param name="application">
/// ASP.NET application.
/// </param>
public void Init(HttpApplication application)
{
application.BeginRequest += BeginRequestHandler;
application.EndRequest += EndRequestHandler;
}
/// <summary>
/// Disposes the module.
/// </summary>
public void Dispose()
{
}
private void BeginRequestHandler(object sender, EventArgs args)
{
BeginRequest?.Invoke(sender, args);
}
private void EndRequestHandler(object sender, EventArgs args)
{
EndRequest?.Invoke(sender, args);
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.