@@ -34,7 +34,8 @@ public static class LoggerConfigurationSplunkExtensions
34
34
/// <param name="batchInterval"></param>
35
35
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
36
36
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
37
- /// <param name="batchSizeLimit"></param>
37
+ /// <param name="batchSizeLimit">The size of the batch prior to writing</param>
38
+ /// <param name="renderTemplate">If true, the message template will be rendered</param>
38
39
/// <returns>Logger configuration, allowing configuration to continue.</returns>
39
40
/// <exception cref="ArgumentNullException">A required parameter is null.</exception>
40
41
/// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
@@ -44,9 +45,10 @@ public static LoggerConfiguration SplunkViaHttp(
44
45
int batchSizeLimit ,
45
46
TimeSpan batchInterval ,
46
47
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
47
- IFormatProvider formatProvider = null )
48
+ IFormatProvider formatProvider = null ,
49
+ bool renderTemplate = true )
48
50
{
49
- var sink = new SplunkViaHttpSink ( context , batchSizeLimit , batchInterval , formatProvider ) ;
51
+ var sink = new SplunkViaHttpSink ( context , batchSizeLimit , batchInterval , formatProvider , renderTemplate ) ;
50
52
51
53
return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
52
54
}
@@ -56,15 +58,16 @@ public static LoggerConfiguration SplunkViaHttp(
56
58
/// </summary>
57
59
/// <param name="loggerConfiguration">The logger configuration.</param>
58
60
/// <param name="context">The Splunk context to log to</param>
59
- /// <param name="password"></param>
61
+ /// <param name="password">The password of the Splunk user </param>
60
62
/// <param name="resourceNameSpace"></param>
61
63
/// <param name="transmitterArgs"></param>
62
64
/// <param name="batchSizeLimit">The size of the batch prior to logging</param>
63
65
/// <param name="batchInterval">The interval on which to log via http</param>
64
66
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
65
67
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
66
- /// <param name="index"></param>
67
- /// <param name="userName"></param>
68
+ /// <param name="index">The name of the Splunk index</param>
69
+ /// <param name="userName">The name of the Splunk user</param>
70
+ /// <param name="renderTemplate">If ture, the message template is rendered</param>
68
71
/// <returns>Logger configuration, allowing configuration to continue.</returns>
69
72
/// <exception cref="ArgumentNullException">A required parameter is null.</exception>
70
73
/// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
@@ -79,7 +82,8 @@ public static LoggerConfiguration SplunkViaHttp(
79
82
Namespace resourceNameSpace ,
80
83
TransmitterArgs transmitterArgs ,
81
84
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
82
- IFormatProvider formatProvider = null )
85
+ IFormatProvider formatProvider = null ,
86
+ bool renderTemplate = true )
83
87
{
84
88
var sink = new SplunkViaHttpSink ( new SplunkContext ( context , index , userName , password , resourceNameSpace , transmitterArgs ) , batchSizeLimit , batchInterval , formatProvider ) ;
85
89
@@ -94,16 +98,18 @@ public static LoggerConfiguration SplunkViaHttp(
94
98
/// <param name="port">The UDP port</param>
95
99
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
96
100
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
101
+ /// <param name="renderTemplate">If ture, the message template will be rendered</param>
97
102
/// <returns></returns>
98
103
/// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
99
104
public static LoggerConfiguration SplunkViaUdp (
100
105
this LoggerSinkConfiguration loggerConfiguration ,
101
106
string host ,
102
107
int port ,
103
108
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
104
- IFormatProvider formatProvider = null )
109
+ IFormatProvider formatProvider = null ,
110
+ bool renderTemplate = true )
105
111
{
106
- var sink = new SplunkViaUdpSink ( host , port , formatProvider ) ;
112
+ var sink = new SplunkViaUdpSink ( host , port , formatProvider , renderTemplate ) ;
107
113
108
114
return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
109
115
}
@@ -117,16 +123,18 @@ public static LoggerConfiguration SplunkViaUdp(
117
123
/// <param name="port">The UDP port</param>
118
124
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
119
125
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
120
- /// <returns></returns>
126
+ /// <param name="renderTemplate">If ture, the message template is rendered</param>
127
+ /// <returns>The logger configuration</returns>
121
128
/// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
122
129
public static LoggerConfiguration SplunkViaUdp (
123
130
this LoggerSinkConfiguration loggerConfiguration ,
124
131
IPAddress hostAddresss ,
125
132
int port ,
126
133
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
127
- IFormatProvider formatProvider = null )
134
+ IFormatProvider formatProvider = null ,
135
+ bool renderTemplate = true )
128
136
{
129
- var sink = new SplunkViaUdpSink ( hostAddresss , port , formatProvider ) ;
137
+ var sink = new SplunkViaUdpSink ( hostAddresss , port , formatProvider , renderTemplate ) ;
130
138
131
139
return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
132
140
}
@@ -139,16 +147,18 @@ public static LoggerConfiguration SplunkViaUdp(
139
147
/// <param name="port">The TCP port</param>
140
148
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
141
149
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
150
+ /// <param name="renderTemplate">If true, the message template is rendered</param>
142
151
/// <returns></returns>
143
152
/// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
144
153
public static LoggerConfiguration SplunkViaTcp (
145
154
this LoggerSinkConfiguration loggerConfiguration ,
146
155
IPAddress hostAddresss ,
147
156
int port ,
148
157
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
149
- IFormatProvider formatProvider = null )
158
+ IFormatProvider formatProvider = null ,
159
+ bool renderTemplate = true )
150
160
{
151
- var sink = new SplunkViaTcpSink ( hostAddresss , port , formatProvider ) ;
161
+ var sink = new SplunkViaTcpSink ( hostAddresss , port , formatProvider , renderTemplate ) ;
152
162
153
163
return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
154
164
}
@@ -161,16 +171,18 @@ public static LoggerConfiguration SplunkViaTcp(
161
171
/// <param name="port">The TCP port</param>
162
172
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
163
173
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
174
+ /// <param name="renderTemplate">If ture, the message template is rendered</param>
164
175
/// <returns></returns>
165
176
/// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
166
177
public static LoggerConfiguration SplunkViaTcp (
167
178
this LoggerSinkConfiguration loggerConfiguration ,
168
179
string host ,
169
180
int port ,
170
181
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
171
- IFormatProvider formatProvider = null )
182
+ IFormatProvider formatProvider = null ,
183
+ bool renderTemplate = true )
172
184
{
173
- var sink = new SplunkViaTcpSink ( host , port , formatProvider ) ;
185
+ var sink = new SplunkViaTcpSink ( host , port , formatProvider , renderTemplate ) ;
174
186
175
187
return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
176
188
}
0 commit comments