Skip to content

Instantly share code, notes, and snippets.

View mivano's full-sized avatar

Michiel van Oudheusden mivano

View GitHub Profile
@mivano
mivano / gist:bbb7563b31177e038608
Last active August 29, 2015 14:03 — forked from nblumhardt/gist:8914175
Serilog extension for log context
public static class LoggerExtensions
{
public static ILogger ForHere(
this ILogger logger,
[CallerFilePath] string sourceFile = null,
[CallerLineNumber] int sourceLine = 0)
{
return logger
.ForContext("SourceFile", sourceFile)
.ForContext("SourceLine", sourceLine);
@mivano
mivano / create log table
Last active August 29, 2015 13:58
Serilog Log table create SQL
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Logs](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Message] [nvarchar](max) NULL,
[MessageTemplate] [nvarchar](max) NULL,
@mivano
mivano / logstash
Created March 21, 2014 15:07
ElasticSearch Logstash index template
{
"template": "logstash*",
"settings": {
"index.analysis.analyzer.default.stopwords": "_none_",
"index.number_of_replicas": "1",
"index.query.default_field": "message",
"index.refresh_interval": "5s",
"index.number_of_shards": "4",
"index.store.compress.stored": "true",
"index.analysis.analyzer.default.type": "standard",