// Add Mandatory Field public void AddMandatoryFields(TraceLogMandatoryField mandatory) { _basicFields.Add("pv", mandatory.ProtocolVersion); _basicFields.Add("kv", mandatory.SDKVersion); _basicFields.Add("cid", mandatory.CompanyId); _basicFields.Add("aid", mandatory.AppId); _basicFields.Add("av", mandatory.AppVersion); _basicFields.Add("uid", mandatory.UserId); _basicFields.Add("did", mandatory.DeviceId); _basicFields.Add("ip", mandatory.ClientIP); _basicFields.Add("t", mandatory.ActionType); _basicNumberFields.Add("ts", mandatory.ClientTimeStamp); }
private TraceLogSerializer AssignDefaultMandatoryAndDebugFields(TraceLogSerializer logSerializer, string actionType, bool isDebug) { TraceLogMandatoryField mandatory = new TraceLogMandatoryField() { ProtocolVersion = PROTOCOL_VERSION, SDKVersion = SDK_VERSION, CompanyId = _companyId, AppId = _appId, AppVersion = _appVersion, UserId = (_useLoggingUserId ? this.UserId : this.DeviceInfo.DeviceID), DeviceId = this.DeviceInfo.DeviceID, ClientIP = this.DeviceInfo.IP, ClientTimeStamp = (int)(System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds, ActionType = actionType, }; logSerializer.AddMandatoryFields(mandatory); logSerializer.IsDebug = isDebug; return(logSerializer); }