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

Update: Extending the Analytics Log

parent 7b65b0cc
No related branches found
No related tags found
2 merge requests!22Product/1188 logging extended,!21Sprint/2021 05
using Newtonsoft.Json.Linq;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Logging
{
......@@ -11,7 +7,8 @@ namespace Coscine.Logging
public class AnalyticsLogObject
{
private string _type = "";
public string Type {
public string Type
{
get
{
return _type;
......@@ -31,7 +28,8 @@ namespace Coscine.Logging
private string _operation = "";
public string Operation {
public string Operation
{
get
{
return _operation;
......@@ -176,6 +174,27 @@ namespace Coscine.Logging
}
}
private List<string> _quotaSize = new List<string>();
public List<string> QuotaSize
{
get
{
return _quotaSize;
}
set
{
if (value == null)
{
_quotaSize = new List<string>();
}
else
{
_quotaSize = value;
}
}
}
private string _resourceId = "";
public string ResourceId
......@@ -218,6 +237,132 @@ namespace Coscine.Logging
}
}
private string _applicationsProfile = "";
public string ApplicationsProfile
{
get
{
return _applicationsProfile;
}
set
{
if (value == null)
{
_applicationsProfile = "";
}
else
{
_applicationsProfile = value;
}
}
}
private string _metadataCompleteness = "";
public string MetadataCompleteness
{
get
{
return _metadataCompleteness;
}
set
{
if (value == null)
{
_metadataCompleteness = "";
}
else
{
_metadataCompleteness = value;
}
}
}
private string _license = "";
public string License
{
get
{
return _license;
}
set
{
if (value == null)
{
_license = "";
}
else
{
_license = value;
}
}
}
private List<string> _disciplines = new List<string>();
public List<string> Disciplines
{
get
{
return _disciplines;
}
set
{
if (value == null)
{
_disciplines = new List<string>();
}
else
{
_disciplines = value;
}
}
}
private List<string> _organizations = new List<string>();
public List<string> Organizations
{
get
{
return _organizations;
}
set
{
if (value == null)
{
_organizations = new List<string>();
}
else
{
_organizations = value;
}
}
}
private string _visibility = "";
public string Visibility
{
get
{
return _visibility;
}
set
{
if (value == null)
{
_visibility = "";
}
else
{
_visibility = value;
}
}
}
private List<string> _projectList = new List<string>();
public List<string> ProjectList
......@@ -281,7 +426,28 @@ namespace Coscine.Logging
}
}
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)
private string _externalInfo = "";
public string ExternalInfo
{
get
{
return _externalInfo;
}
set
{
if (value == null)
{
_externalInfo = "";
}
else
{
_externalInfo = value;
}
}
}
public AnalyticsLogObject(string type, string operation, DateTime timestamp, string userId, string roleId, string sessionId, string clientCorrolationId, string projectId, List<string> quotaSize, string resourceId, string fileId, string applicationsProfile, string metadataCompleteness, string license, List<string> disciplines, List<string> organizations, string visibility, List<string> projectList, List<string> resourceList, List<string> userList, string externalInfo)
{
Type = type;
Operation = operation;
......@@ -291,11 +457,19 @@ namespace Coscine.Logging
SessionId = sessionId;
ClientCorrolationId = clientCorrolationId;
ProjectId = projectId;
QuotaSize = quotaSize;
ResourceId = resourceId;
FileId = fileId;
ApplicationsProfile = applicationsProfile;
MetadataCompleteness = metadataCompleteness;
License = license;
Disciplines = disciplines;
Organizations = organizations;
Visibility = visibility;
ProjectList = projectList;
ResourceList = resourceList;
UserList = userList;
ExternalInfo = externalInfo;
}
public AnalyticsLogObject()
......@@ -304,7 +478,7 @@ namespace Coscine.Logging
private static string FormatTimestamp(DateTime timestamp)
{
string formattedDateTime = String.Format("{0:yyyy-MM-dd hh:mm:ss.fff}", timestamp);
string formattedDateTime = string.Format("{0:yyyy-MM-dd hh:mm:ss.fff}", timestamp);
return formattedDateTime;
}
}
......
using NLog;
using System;
using System.Diagnostics;
using System.Text;
using NLog.Targets;
using Consul;
using LogLevel = NLog.LogLevel;
using System.Text.RegularExpressions;
using NLog.Config;
using Microsoft.Extensions.Logging;
using NLog.LayoutRenderers;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using NLog;
using System;
namespace Coscine.Logging
{
......
......@@ -3,12 +3,9 @@ using NLog;
using NLog.Config;
using NLog.LayoutRenderers;
using NLog.Targets;
using LogLevel = NLog.LogLevel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LogLevel = NLog.LogLevel;
namespace Coscine.Logging
{
......
using NLog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Coscine.Logging
{
......@@ -74,7 +70,7 @@ namespace Coscine.Logging
public static void SetClientCorrolationId(Guid clientCorrolationId)
{
CoscineLoggerMetadata.SetClientCorrolationId(clientCorrolationId.ToString());
SetClientCorrolationId(clientCorrolationId.ToString());
}
public static string GetClientCorrolationId()
......
using NLog;
using NLog.LayoutRenderers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Logging
{
......
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>Coscine.Logging</RootNamespace>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment