Globaldizajn.ErrorMailer 1.1.1

dotnet add package Globaldizajn.ErrorMailer --version 1.1.1
NuGet\Install-Package Globaldizajn.ErrorMailer -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Globaldizajn.ErrorMailer" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Globaldizajn.ErrorMailer --version 1.1.1
#r "nuget: Globaldizajn.ErrorMailer, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Globaldizajn.ErrorMailer as a Cake Addin
#addin nuget:?package=Globaldizajn.ErrorMailer&version=1.1.1

// Install Globaldizajn.ErrorMailer as a Cake Tool
#tool nuget:?package=Globaldizajn.ErrorMailer&version=1.1.1

Custom Error Mailer

Error mailer koji jeste custom.

Podaci koje skuplja

(Taksativno nabrojani, idiomatski opisani)

  • Stack trace
  • Url (sada 30% više querystringa)
  • Rewriteani URL
  • Post podatci
  • Keyevi u sessionu
  • Godišnjice braka
  • Odgovore na pitanja o postojanju
  • Serijaliziranje request objekta (Za hoardera u vašem životu)

U fullDump modu:

  • Potpuni session dump (Json serialized)
  • Potpuni cache dump (moar json)

Install

Config

  • U global.asax-u se mogu postaviti ovi:
     <%@ Import Namespace="ErrorMailer.Globaldizajn.HealthMonitoring"%>
    
    
    <script RunAt="server">
    
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
      	   ErrorMailer.targetEmail = "jab.drugi@mail.hr"
        ErrorMailer.enableSsl = True
        ErrorMailer.smtp = "mail.test.com"
        ErrorMailer.username = "example@example.com"
        ErrorMailer.password = "123123"
        ErrorMailer.fromEmail = "example@test.hr"
        ErrorMailer.fromName = "error"
        'not setting this value defaults the subject to the application root folder name 
        ErrorMailer.subject = "somesubject"
        ErrorMailer.divHighlightedStyle = "background-color:#ffffcc;"
        ErrorMailer.divStyle = "background-color:#eee"
        ErrorMailer.fontHighlightedStyle = "color:#dd0000"
        ErrorMailer.fontExceptionStyle = "color:maroon"
    End Sub
    </script>
    
  • Slanje maila za hendlane iznimke (U try catchu, na primjer)
         Public Shared Sub fireMailForCaughtException(ex As Exception) 
  • Ako koristite neke specijalne postavke tipa queueing ili posebne mailer librarye, možete definirati svoju funkciju za slanje maila kroz ovaj interface:

  • (primjer je za Hangfire, može se staviti štogod)

        Imports System.Net.Mail
        Imports ErrorMailer.Globaldizajn.HealthMonitoring
        Imports Hangfire
    
    
        Public Class ErrorMailSender
            Implements customMailer
    
            Public Sub fireMail(body As String, subject As String) Implements customMailer.fireMail
                BackgroundJob.Enqueue(Sub() fireMailSetup(body, subject))
            End Sub
    
            Public Shared Sub fireMailSetup(text As String, subject As String)
    
                Dim mail As New MailMessage()
                Dim SmtpServer As New SmtpClient("localhost")
                mail.From = New MailAddress("lidless.eye@globaldizajn.hr", "error")
                mail.To.Add("lovro.gamulin@globaldizajn.com")
    
                mail.Subject = subject
                mail.Body = text
                mail.IsBodyHtml = True
    
                SmtpServer.Send(mail)
            End Sub
        End Class
    
  • Nakon ove definicije, nova klasa se mora dodati u http modul u global.asaxu:

     <%@ Import Namespace="ErrorMailer.Globaldizajn.HealthMonitoring.ErrorMailer"%>
    
    
    <script RunAt="server">
    
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        mailer = New ErrorMailSender
    End Sub
    </script>
    
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 1,237 11/13/2017
1.1.0 925 11/6/2017
1.0.9 995 7/25/2017
1.0.8 933 7/21/2017
1.0.7 1,056 7/5/2017
1.0.6 931 6/27/2017
1.0.5 1,048 6/20/2017

Formatting and visual overhauls