Last active
October 7, 2017 01:36
-
-
Save sirkirby/53aed2328d556854008eb1a3c5306cd3 to your computer and use it in GitHub Desktop.
Sending a custom event grid log through serilog event grid sink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using the ILogger Event extension methods | |
Logger.Event("import", $"myApp/myLogic/customRecord", "Processing completed {@recordCount}", records.Count); | |
Log.EventType("import", "Processing completed {@recordCount}", records.Count); | |
Log.EventSubject("myApp/myLogic/customRecord", "Processing completed {@recordCount}", records.Count); | |
// use attributes | |
[EventGridSubject("myApp/myLogic/customRecord")] | |
public class MyImportClass | |
{ | |
[EventGridType("import")] | |
public void Import(object[] records) | |
{ | |
Log.Information("Processing completed {@recordCount}", records.Count); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment