Walter.BOM Namespace
Walter.Web.FireWall Namespace
ASP-WAF Web application firewall for .Net 6, .Net 5, .Net Standard 2.1 and .Net Core 3.x

ILoggerReportingExtensions Class

Enables the FireWall to send incidents to the ILogger interface of the application using a specific log level.

Namespace:  Microsoft.Extensions.DependencyInjection
Assembly:  Walter.Web.FireWall.ILogger (in Walter.Web.FireWall.ILogger.dll)

Syntax


public static class ILoggerReportingExtensions

Remarks


You can specify the importance you would like to give the firewall incidents when reporting the incidents to the ILogger interface you are using. All types of incidents as well as the "expiry" info messages of these incidents will be logged with the same log level.

Examples


You find the ILogger extension method for the Walter.Waf.Web.IFirewall in NuGet package Walter.Web.FireWall.ILoggerReporting
C#
services.AddFireWall(FireWallTrial.License, FireWallTrial.DomainKey
    , domainName: new Uri("https://www.your-domain.com", UriKind.Absolute)
    , options =>
    {
        options.Cypher.ApplicationPassword = "123456$even";
        options.ApplicationName = "Name as used for reporting";
        options.ApplicationTag = "ITIL Tag";
        options.Rules.BlockRequest.BlockDuration.SlideExpiration = true;
        options.Rules.BlockRequest.BlockDuration.Expires = TimeSpan.FromSeconds(10);

        //used by JavaScript in the browser
        options.WebServices.IsUserApiUrl = new Uri(Links.IsUserEndpoint, UriKind.Relative);
        options.WebServices.RegisterLinksApiUrl = new Uri(Links.SiteMapEndPoint, UriKind.Relative);
        options.WebServices.BeaconApiUrl = new Uri(Links.BeaconPoint, UriKind.Relative);

}).UseILoggerLogging(level: Microsoft.Extensions.Logging.LogLevel.Critical);