forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRequestLogger.cs
More file actions
63 lines (54 loc) · 1.67 KB
/
IRequestLogger.cs
File metadata and controls
63 lines (54 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
namespace ServiceStack.Web
{
/// <summary>
/// Log every service request
/// </summary>
public interface IRequestLogger
{
/// <summary>
/// Turn On/Off Session Tracking
/// </summary>
bool EnableSessionTracking { get; set; }
/// <summary>
/// Turn On/Off Raw Request Body Tracking
/// </summary>
bool EnableRequestBodyTracking { get; set; }
/// <summary>
/// Turn On/Off Tracking of Responses
/// </summary>
bool EnableResponseTracking { get; set; }
/// <summary>
/// Turn On/Off Tracking of Exceptions
/// </summary>
bool EnableErrorTracking { get; set; }
/// <summary>
/// Limit access to /requestlogs service to role
/// </summary>
string[] RequiredRoles { get; set; }
/// <summary>
/// Don't log requests of these types.
/// </summary>
Type[] ExcludeRequestDtoTypes { get; set; }
/// <summary>
/// Don't log request bodys for services with sensitive information.
/// By default Auth and Registration requests are hidden.
/// </summary>
Type[] HideRequestBodyForRequestDtoTypes { get; set; }
/// <summary>
/// Log a request
/// </summary>
/// <param name="requestContext">The RequestContext</param>
/// <param name="requestDto">Request DTO</param>
/// <param name="response">Response DTO or Exception</param>
/// <param name="elapsed">How long did the Request take</param>
void Log(IRequestContext requestContext, object requestDto, object response, TimeSpan elapsed);
/// <summary>
/// View the most recent logs
/// </summary>
/// <param name="take"></param>
/// <returns></returns>
List<RequestLogEntry> GetLatestLogs(int? take);
}
}