diff --git a/src/Logging/AnalyticsLogObject.cs b/src/Logging/AnalyticsLogObject.cs index 6f30f5d2c162614c5eea98a9349863cf05f21d4a..0644b566bc03c6e083d86c75411e45f15848ac36 100644 --- a/src/Logging/AnalyticsLogObject.cs +++ b/src/Logging/AnalyticsLogObject.cs @@ -1,9 +1,5 @@ -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; } } diff --git a/src/Logging/CoscineLogger.cs b/src/Logging/CoscineLogger.cs index 2e4b4075cd9c48a34f192016e609defcb9710767..f19b2237f09821ede4b7e5d165a91b2babd7dc05 100644 --- a/src/Logging/CoscineLogger.cs +++ b/src/Logging/CoscineLogger.cs @@ -1,16 +1,7 @@ -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 { diff --git a/src/Logging/CoscineLoggerConfiguration.cs b/src/Logging/CoscineLoggerConfiguration.cs index 1c8849d1f312af420be5b23fab53c2ef62b50b96..7ab6afb5ae86b2150861125b168fd24aba88add9 100644 --- a/src/Logging/CoscineLoggerConfiguration.cs +++ b/src/Logging/CoscineLoggerConfiguration.cs @@ -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 { diff --git a/src/Logging/CoscineLoggerMetadata.cs b/src/Logging/CoscineLoggerMetadata.cs index 3e8593784f1fc2e7dfe647755945df04377aeb64..ab89e5fe41a7c55e9e561a34ba34df0645937a77 100644 --- a/src/Logging/CoscineLoggerMetadata.cs +++ b/src/Logging/CoscineLoggerMetadata.cs @@ -1,11 +1,7 @@ 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() diff --git a/src/Logging/LogLevelLayoutRenderer.cs b/src/Logging/LogLevelLayoutRenderer.cs index dc42b8e329c03a04948791c261604a388b8779fd..3945b9bdda09ae40fe38f7152bcdd2fc9a7f1501 100644 --- a/src/Logging/LogLevelLayoutRenderer.cs +++ b/src/Logging/LogLevelLayoutRenderer.cs @@ -1,10 +1,6 @@ using NLog; using NLog.LayoutRenderers; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace Coscine.Logging { diff --git a/src/Logging/Logging.csproj b/src/Logging/Logging.csproj index 302b364e3a85e0296d861cfd7b494d852c0b9db8..af1306b04d84ec1a9a17b980236fdbbf7e5e8ea4 100644 --- a/src/Logging/Logging.csproj +++ b/src/Logging/Logging.csproj @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Library</OutputType> <RootNamespace>Coscine.Logging</RootNamespace>