Skip to content
Snippets Groups Projects
Commit 5263c7a5 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Hotfix/774-fixAnalyticsLogs' into 'master'

Hotfix/774-fixAnalyticsLogs

See merge request coscine/cs/logging!11
parents 97dea427 9bde0774
No related branches found
No related tags found
1 merge request!11Hotfix/774-fixAnalyticsLogs
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Logging.Tests is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Logging.Tests")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.0-topic-671-readab0009")]
[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyFileVersion("1.2.0")]
[assembly: AssemblyInformationalVersion("1.2.0-beta0003")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
......@@ -10,38 +10,282 @@ namespace Coscine.Logging
[Serializable]
public class AnalyticsLogObject
{
public string Type { get; set; }
private string _type = "";
public string Type {
get
{
return _type;
}
set
{
if (value == null)
{
_type = "";
}
else
{
_type = value;
}
}
}
private string _operation = "";
public string Operation { get; set; }
public string Operation {
get
{
return _operation;
}
set
{
if (value == null)
{
_operation = "";
}
else
{
_operation = value;
}
}
}
// Default is the current time
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
private string _timestamp = FormatTimestamp(DateTime.UtcNow);
public string Timestamp
{
get
{
return _timestamp;
}
set
{
if (value == null)
{
_timestamp = FormatTimestamp(DateTime.UtcNow);
}
else
{
_timestamp = value;
}
}
}
private string _userId = "";
public string UserId
{
get
{
return _userId;
}
set
{
if (value == null)
{
_userId = "";
}
else
{
_userId = value;
}
}
}
public string UserId { get; set; }
private string _roleId = "";
public string RoleId { get; set; }
public string RoleId
{
get
{
return _roleId;
}
set
{
if (value == null)
{
_roleId = "";
}
else
{
_roleId = value;
}
}
}
public string SessionId { get; set; }
private string _sessionId = "";
public string ClientCorrolationId { get; set; }
public string SessionId
{
get
{
return _sessionId;
}
set
{
if (value == null)
{
_sessionId = "";
}
else
{
_sessionId = value;
}
}
}
public string ProjectId { get; set; }
private string _clientCorrolationId = "";
public string ResourceId { get; set; }
public string ClientCorrolationId
{
get
{
return _clientCorrolationId;
}
set
{
if (value == null)
{
_clientCorrolationId = "";
}
else
{
_clientCorrolationId = value;
}
}
}
public string FileId { get; set; }
private string _projectId = "";
public List<string> ProjectList { get; set; }
public string ProjectId
{
get
{
return _projectId;
}
set
{
if (value == null)
{
_projectId = "";
}
else
{
_projectId = value;
}
}
}
public List<string> ResourceList { get; set; }
private string _resourceId = "";
public List<string> UserList { get; set; }
public string ResourceId
{
get
{
return _resourceId;
}
set
{
if (value == null)
{
_resourceId = "";
}
else
{
_resourceId = value;
}
}
}
private string _fileId = "";
public string FileId
{
get
{
return _fileId;
}
set
{
if (value == null)
{
_fileId = "";
}
else
{
_fileId = value;
}
}
}
private List<string> _projectList = new List<string>();
public List<string> ProjectList
{
get
{
return _projectList;
}
set
{
if (value == null)
{
_projectList = new List<string>();
}
else
{
_projectList = value;
}
}
}
private List<string> _resourceList = new List<string>();
public List<string> ResourceList
{
get
{
return _resourceList;
}
set
{
if (value == null)
{
_resourceList = new List<string>();
}
else
{
_resourceList = value;
}
}
}
private List<string> _userList = new List<string>();
public List<string> UserList
{
get
{
return _userList;
}
set
{
if (value == null)
{
_userList = new List<string>();
}
else
{
_userList = value;
}
}
}
public AnalyticsLogObject (string type, string operation, DateTime timestamp, string userId, string roleId, string sessionId, string clientCorrolationId, string projectId, string resourceId, string fileId, List<string> projectList, List<string> resourceList, List<string> userList)
{
Type = type;
Operation = operation;
Timestamp = timestamp;
Timestamp = FormatTimestamp(timestamp);
UserId = userId;
RoleId = roleId;
SessionId = sessionId;
......@@ -57,5 +301,11 @@ namespace Coscine.Logging
public AnalyticsLogObject()
{
}
private static string FormatTimestamp(DateTime timestamp)
{
string formattedDateTime = String.Format("{0:yyyy-MM-dd hh:mm:ss.fff}", timestamp);
return formattedDateTime;
}
}
}
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Logging is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Logging")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.0-topic-671-readab0009")]
[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyFileVersion("1.2.0")]
[assembly: AssemblyInformationalVersion("1.2.0-beta0003")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment