@@ -34,7 +34,8 @@ public static class LoggerConfigurationSplunkExtensions
3434 /// <param name="batchInterval"></param>
3535 /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
3636 /// <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>
3839 /// <returns>Logger configuration, allowing configuration to continue.</returns>
3940 /// <exception cref="ArgumentNullException">A required parameter is null.</exception>
4041 /// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
@@ -44,9 +45,10 @@ public static LoggerConfiguration SplunkViaHttp(
4445 int batchSizeLimit ,
4546 TimeSpan batchInterval ,
4647 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
47- IFormatProvider formatProvider = null )
48+ IFormatProvider formatProvider = null ,
49+ bool renderTemplate = true )
4850 {
49- var sink = new SplunkViaHttpSink ( context , batchSizeLimit , batchInterval , formatProvider ) ;
51+ var sink = new SplunkViaHttpSink ( context , batchSizeLimit , batchInterval , formatProvider , renderTemplate ) ;
5052
5153 return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
5254 }
@@ -56,15 +58,16 @@ public static LoggerConfiguration SplunkViaHttp(
5658 /// </summary>
5759 /// <param name="loggerConfiguration">The logger configuration.</param>
5860 /// <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>
6062 /// <param name="resourceNameSpace"></param>
6163 /// <param name="transmitterArgs"></param>
6264 /// <param name="batchSizeLimit">The size of the batch prior to logging</param>
6365 /// <param name="batchInterval">The interval on which to log via http</param>
6466 /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
6567 /// <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>
6871 /// <returns>Logger configuration, allowing configuration to continue.</returns>
6972 /// <exception cref="ArgumentNullException">A required parameter is null.</exception>
7073 /// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
@@ -79,7 +82,8 @@ public static LoggerConfiguration SplunkViaHttp(
7982 Namespace resourceNameSpace ,
8083 TransmitterArgs transmitterArgs ,
8184 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
82- IFormatProvider formatProvider = null )
85+ IFormatProvider formatProvider = null ,
86+ bool renderTemplate = true )
8387 {
8488 var sink = new SplunkViaHttpSink ( new SplunkContext ( context , index , userName , password , resourceNameSpace , transmitterArgs ) , batchSizeLimit , batchInterval , formatProvider ) ;
8589
@@ -94,16 +98,18 @@ public static LoggerConfiguration SplunkViaHttp(
9498 /// <param name="port">The UDP port</param>
9599 /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
96100 /// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
101+ /// <param name="renderTemplate">If ture, the message template will be rendered</param>
97102 /// <returns></returns>
98103 /// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
99104 public static LoggerConfiguration SplunkViaUdp (
100105 this LoggerSinkConfiguration loggerConfiguration ,
101106 string host ,
102107 int port ,
103108 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
104- IFormatProvider formatProvider = null )
109+ IFormatProvider formatProvider = null ,
110+ bool renderTemplate = true )
105111 {
106- var sink = new SplunkViaUdpSink ( host , port , formatProvider ) ;
112+ var sink = new SplunkViaUdpSink ( host , port , formatProvider , renderTemplate ) ;
107113
108114 return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
109115 }
@@ -117,16 +123,18 @@ public static LoggerConfiguration SplunkViaUdp(
117123 /// <param name="port">The UDP port</param>
118124 /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
119125 /// <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>
121128 /// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
122129 public static LoggerConfiguration SplunkViaUdp (
123130 this LoggerSinkConfiguration loggerConfiguration ,
124131 IPAddress hostAddresss ,
125132 int port ,
126133 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
127- IFormatProvider formatProvider = null )
134+ IFormatProvider formatProvider = null ,
135+ bool renderTemplate = true )
128136 {
129- var sink = new SplunkViaUdpSink ( hostAddresss , port , formatProvider ) ;
137+ var sink = new SplunkViaUdpSink ( hostAddresss , port , formatProvider , renderTemplate ) ;
130138
131139 return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
132140 }
@@ -139,16 +147,18 @@ public static LoggerConfiguration SplunkViaUdp(
139147 /// <param name="port">The TCP port</param>
140148 /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
141149 /// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
150+ /// <param name="renderTemplate">If true, the message template is rendered</param>
142151 /// <returns></returns>
143152 /// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
144153 public static LoggerConfiguration SplunkViaTcp (
145154 this LoggerSinkConfiguration loggerConfiguration ,
146155 IPAddress hostAddresss ,
147156 int port ,
148157 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
149- IFormatProvider formatProvider = null )
158+ IFormatProvider formatProvider = null ,
159+ bool renderTemplate = true )
150160 {
151- var sink = new SplunkViaTcpSink ( hostAddresss , port , formatProvider ) ;
161+ var sink = new SplunkViaTcpSink ( hostAddresss , port , formatProvider , renderTemplate ) ;
152162
153163 return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
154164 }
@@ -161,16 +171,18 @@ public static LoggerConfiguration SplunkViaTcp(
161171 /// <param name="port">The TCP port</param>
162172 /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
163173 /// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
174+ /// <param name="renderTemplate">If ture, the message template is rendered</param>
164175 /// <returns></returns>
165176 /// <remarks>TODO: Add link to splunk configuration and wiki</remarks>
166177 public static LoggerConfiguration SplunkViaTcp (
167178 this LoggerSinkConfiguration loggerConfiguration ,
168179 string host ,
169180 int port ,
170181 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
171- IFormatProvider formatProvider = null )
182+ IFormatProvider formatProvider = null ,
183+ bool renderTemplate = true )
172184 {
173- var sink = new SplunkViaTcpSink ( host , port , formatProvider ) ;
185+ var sink = new SplunkViaTcpSink ( host , port , formatProvider , renderTemplate ) ;
174186
175187 return loggerConfiguration . Sink ( sink , restrictedToMinimumLevel ) ;
176188 }
0 commit comments