@@ -38,7 +38,7 @@ public SplunkHECJsonLoggerProvider(SplunkLoggerConfiguration configuration, ILog
38
38
39
39
SetupHttpClient ( configuration , "event" ) ;
40
40
41
- batchController = new BatchManager ( configuration . HecConfiguration . BatchSizeCount , configuration . HecConfiguration . BatchIntervalInMiliseconds , Emit ) ;
41
+ batchController = new BatchManager ( configuration . HecConfiguration . BatchSizeCount , configuration . HecConfiguration . BatchIntervalInMilliseconds , Emit ) ;
42
42
}
43
43
44
44
/// <summary>
@@ -87,7 +87,41 @@ public void Emit(List<object> events)
87
87
httpClient . PostAsync ( string . Empty , stringContent )
88
88
. ContinueWith ( task => {
89
89
if ( task . IsCompletedSuccessfully )
90
- Debug . WriteLine ( "Splunk HEC RAW Status: Sucess" ) ;
90
+ switch ( task . Result . StatusCode )
91
+ {
92
+ case System . Net . HttpStatusCode . OK :
93
+ Debug . WriteLine ( "Splunk HEC JSON Status: Request completed successfully." ) ;
94
+ break ;
95
+ case System . Net . HttpStatusCode . Created :
96
+ Debug . WriteLine ( "Splunk HEC JSON Status: Create request completed successfully." ) ;
97
+ break ;
98
+ case System . Net . HttpStatusCode . BadRequest :
99
+ Debug . WriteLine ( "Splunk HEC JSON Status: Request error. See response body for details." ) ;
100
+ break ;
101
+ case System . Net . HttpStatusCode . Unauthorized :
102
+ Debug . WriteLine ( "Splunk HEC JSON Status: Authentication failure, invalid access credentials." ) ;
103
+ break ;
104
+ case System . Net . HttpStatusCode . PaymentRequired :
105
+ Debug . WriteLine ( "Splunk HEC JSON Status: In-use Splunk Enterprise license disables this feature." ) ;
106
+ break ;
107
+ case System . Net . HttpStatusCode . Forbidden :
108
+ Debug . WriteLine ( "Splunk HEC JSON Status: Insufficient permission." ) ;
109
+ break ;
110
+ case System . Net . HttpStatusCode . NotFound :
111
+ Debug . WriteLine ( "Splunk HEC JSON Status: Requested endpoint does not exist." ) ;
112
+ break ;
113
+ case System . Net . HttpStatusCode . Conflict :
114
+ Debug . WriteLine ( "Splunk HEC JSON Status: Invalid operation for this endpoint. See response body for details." ) ;
115
+ break ;
116
+ case System . Net . HttpStatusCode . InternalServerError :
117
+ Debug . WriteLine ( "Splunk HEC JSON Status: Unspecified internal server error. See response body for details." ) ;
118
+ break ;
119
+ case System . Net . HttpStatusCode . ServiceUnavailable :
120
+ Debug . WriteLine ( "Splunk HEC JSON Status: Feature is disabled in configuration file." ) ;
121
+ break ;
122
+ default :
123
+ break ;
124
+ }
91
125
else if ( task . IsCanceled )
92
126
Debug . WriteLine ( "Splunk HEC RAW Status: Canceled" ) ;
93
127
else
0 commit comments