You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.4 KiB
42 lines
1.4 KiB
|
|
namespace DealerSelection.Common.Logging;
|
|
|
|
public class RequestInfo
|
|
{
|
|
public RequestInfo(string hostName, string httpMethod, string uri, DateTime startDate)
|
|
{
|
|
HostName = hostName;
|
|
HttpMethod = httpMethod;
|
|
Uri = uri;
|
|
StartDate = startDate;
|
|
}
|
|
|
|
public string HostName { get; set; }
|
|
public string HttpMethod { get; set; }
|
|
public string Uri { get; set; }
|
|
public DateTime? StartDate { get; set; }
|
|
public int? RecordId { get; set; }
|
|
public int? BuId { get; set; }
|
|
public string? SecurityContext { get; set; }
|
|
public string? ContentBody { get; set; }
|
|
public string? ExceptionStack { get; set;}
|
|
public string? RealException { get; set; }
|
|
public string? InnerException { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{nameof(BuId)}:{ BuId},{nameof(RecordId)}:{RecordId},{nameof(HostName)}:{HostName}," +
|
|
$"{nameof(HttpMethod)}:{HttpMethod},{nameof(Uri)}:{Uri},{nameof(StartDate)}:{StartDate}," +
|
|
$"{nameof(SecurityContext)}:{SecurityContext},{nameof(ContentBody)}:{ContentBody}," +
|
|
$"{nameof(ExceptionStack)}:{ExceptionStack},{nameof(RealException)}:{RealException},{nameof(InnerException)}:{InnerException}";
|
|
}
|
|
|
|
public string BuildRequestData()
|
|
{
|
|
if(string.IsNullOrWhiteSpace(ContentBody))
|
|
{
|
|
return Uri;
|
|
}
|
|
return $"{Uri} with {ContentBody}";
|
|
}
|
|
}
|