Add Tests Project
This commit is contained in:
parent
c832b63f2f
commit
831dd58078
@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csp
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Viewer", "Viewer\Viewer.csproj", "{25C86DF8-EC1A-4D4B-AD4E-6561174824B9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -30,5 +32,9 @@ Global
|
||||
{25C86DF8-EC1A-4D4B-AD4E-6561174824B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{25C86DF8-EC1A-4D4B-AD4E-6561174824B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{25C86DF8-EC1A-4D4B-AD4E-6561174824B9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -29,11 +29,7 @@
|
||||
<PropertyGroup Condition="'$(IsLinux)'=='true'">
|
||||
<DefineConstants>Linux</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
60
Tests/Models/AppSettings.cs
Normal file
60
Tests/Models/AppSettings.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Tests.Models;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
protected string _ApiLoggingContentTypes;
|
||||
protected string _ApiLoggingPathPrefixes;
|
||||
protected string _ApiLogPath;
|
||||
protected string _AttachmentPath;
|
||||
protected string _BuildNumber;
|
||||
protected string _Company;
|
||||
protected string _ConnectionString;
|
||||
protected string _GitCommitSeven;
|
||||
protected string _InboundApiAllowedIPList;
|
||||
protected string _MonARessource;
|
||||
protected string _OIExportPath;
|
||||
protected string _URLs;
|
||||
protected string _WorkingDirectoryName;
|
||||
public string ApiLoggingContentTypes => _ApiLoggingContentTypes;
|
||||
public string ApiLoggingPathPrefixes => _ApiLoggingPathPrefixes;
|
||||
public string ApiLogPath => _ApiLogPath;
|
||||
public string AttachmentPath => _AttachmentPath;
|
||||
public string BuildNumber => _BuildNumber;
|
||||
public string Company => _Company;
|
||||
public string ConnectionString => _ConnectionString;
|
||||
public string GitCommitSeven => _GitCommitSeven;
|
||||
public string InboundApiAllowedIPList => _InboundApiAllowedIPList;
|
||||
public string MonARessource => _MonARessource;
|
||||
public string OIExportPath => _OIExportPath;
|
||||
public string URLs => _URLs;
|
||||
public string WorkingDirectoryName => _WorkingDirectoryName;
|
||||
|
||||
[JsonConstructor]
|
||||
public AppSettings(string apiLoggingContentTypes, string apiLoggingPathPrefixes, string apiLogPath, string attachmentPath, string buildNumber, string company, string connectionString, string gitCommitSeven, string inboundApiAllowedIPList, string monARessource, string oiExportPath, string urls, string workingDirectoryName)
|
||||
{
|
||||
_ApiLoggingContentTypes = apiLoggingContentTypes;
|
||||
_ApiLoggingPathPrefixes = apiLoggingPathPrefixes;
|
||||
_ApiLogPath = apiLogPath;
|
||||
_AttachmentPath = attachmentPath;
|
||||
_BuildNumber = buildNumber;
|
||||
_Company = company;
|
||||
_ConnectionString = connectionString;
|
||||
_GitCommitSeven = gitCommitSeven;
|
||||
_InboundApiAllowedIPList = inboundApiAllowedIPList;
|
||||
_MonARessource = monARessource;
|
||||
_OIExportPath = oiExportPath;
|
||||
_URLs = urls;
|
||||
_WorkingDirectoryName = workingDirectoryName;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
46
Tests/Models/Binder/AppSettings.cs
Normal file
46
Tests/Models/Binder/AppSettings.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace OI.Metrology.Tests.Models.Binder;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
[Display(Name = "Api Logging Content Types"), Required] public string ApiLoggingContentTypes { get; set; }
|
||||
[Display(Name = "Api Logging Path Prefixes"), Required] public string ApiLoggingPathPrefixes { get; set; }
|
||||
[Display(Name = "Api Log Path"), Required] public string ApiLogPath { get; set; }
|
||||
[Display(Name = "Attachment Path"), Required] public string AttachmentPath { get; set; }
|
||||
[Display(Name = "Build Number"), Required] public string BuildNumber { get; set; }
|
||||
[Display(Name = "Company"), Required] public string Company { get; set; }
|
||||
[Display(Name = "Connection String"), Required] public string ConnectionString { get; set; }
|
||||
[Display(Name = "Git Commit Seven"), Required] public string GitCommitSeven { get; set; }
|
||||
[Display(Name = "Inbound Api Allowed IP List"), Required] public string InboundApiAllowedIPList { get; set; }
|
||||
[Display(Name = "MonA Ressource"), Required] public string MonARessource { get; set; }
|
||||
[Display(Name = "OI Export Path"), Required] public string OIExportPath { get; set; }
|
||||
[Display(Name = "URLs"), Required] public string URLs { get; set; }
|
||||
[Display(Name = "Working Directory Name"), Required] public string WorkingDirectoryName { get; set; }
|
||||
|
||||
public AppSettings()
|
||||
{
|
||||
ApiLoggingContentTypes = string.Empty;
|
||||
ApiLoggingPathPrefixes = string.Empty;
|
||||
ApiLogPath = string.Empty;
|
||||
AttachmentPath = string.Empty;
|
||||
BuildNumber = string.Empty;
|
||||
Company = string.Empty;
|
||||
ConnectionString = string.Empty;
|
||||
GitCommitSeven = string.Empty;
|
||||
InboundApiAllowedIPList = string.Empty;
|
||||
MonARessource = string.Empty;
|
||||
OIExportPath = string.Empty;
|
||||
URLs = string.Empty;
|
||||
WorkingDirectoryName = string.Empty;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
44
Tests/Models/Stateless/AppSettings.cs
Normal file
44
Tests/Models/Stateless/AppSettings.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace OI.Metrology.Tests.Models.Stateless;
|
||||
|
||||
public abstract class AppSettings
|
||||
{
|
||||
|
||||
#nullable enable
|
||||
|
||||
public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
|
||||
{
|
||||
Models.AppSettings? result;
|
||||
Binder.AppSettings appSettings = configurationRoot.Get<Binder.AppSettings>();
|
||||
string json = JsonSerializer.Serialize(appSettings, new JsonSerializerOptions() { WriteIndented = true });
|
||||
result = JsonSerializer.Deserialize<Models.AppSettings>(json);
|
||||
if (result is null)
|
||||
throw new Exception(json);
|
||||
if (string.IsNullOrEmpty(result.Company))
|
||||
throw new Exception(json);
|
||||
string jsonThis = result.ToString();
|
||||
if (jsonThis != json)
|
||||
{
|
||||
int? check = null;
|
||||
int min = new int[] { json.Length, jsonThis.Length }.Min();
|
||||
for (int i = 0; i < min; i++)
|
||||
{
|
||||
if (json[i] == jsonThis[i])
|
||||
continue;
|
||||
check = i;
|
||||
break;
|
||||
}
|
||||
if (check is null)
|
||||
throw new Exception();
|
||||
string a = json[..check.Value].Split(',')[^1];
|
||||
string b = json[check.Value..].Split(',')[0];
|
||||
throw new Exception($"{a}{b}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
49
Tests/Tests.csproj
Normal file
49
Tests/Tests.csproj
Normal file
@ -0,0 +1,49 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
||||
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
||||
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsWindows)'=='true'">
|
||||
<DefineConstants>Windows</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsOSX)'=='true'">
|
||||
<DefineConstants>OSX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsLinux)'=='true'">
|
||||
<DefineConstants>Linux</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Shared\Shared.csproj" />
|
||||
<ProjectReference Include="..\Archive\Archive.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
62
Tests/UnitTestArchive.cs
Normal file
62
Tests/UnitTestArchive.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using System.Reflection;
|
||||
using OI.Metrology.Tests.Models;
|
||||
using OI.Metrology.Shared.Models;
|
||||
|
||||
namespace View_by_Distance.Tests;
|
||||
|
||||
[TestClass]
|
||||
public class UnitTestArchive
|
||||
{
|
||||
|
||||
private readonly ILogger _Logger;
|
||||
private readonly AppSettings _AppSettings;
|
||||
private readonly string _WorkingDirectory;
|
||||
private readonly IConfigurationRoot _ConfigurationRoot;
|
||||
|
||||
public UnitTestArchive()
|
||||
{
|
||||
ILogger logger;
|
||||
AppSettings appSettings;
|
||||
string workingDirectory;
|
||||
IConfigurationRoot configurationRoot;
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.Development.json");
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = OI.Metrology.Tests.Models.Stateless.AppSettings.Get(configurationRoot);
|
||||
workingDirectory = IWorkingDirectory.GetWorkingDirectory(assembly.GetName().Name, appSettings.WorkingDirectoryName);
|
||||
Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
|
||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, configurationRoot);
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
logger = Log.ForContext<UnitTestArchive>();
|
||||
logger.Information("Complete");
|
||||
_Logger = logger;
|
||||
_AppSettings = appSettings;
|
||||
_WorkingDirectory = workingDirectory;
|
||||
_ConfigurationRoot = configurationRoot;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodNull()
|
||||
{
|
||||
Assert.IsFalse(_Logger is null);
|
||||
Assert.IsFalse(_AppSettings is null);
|
||||
Assert.IsFalse(_WorkingDirectory is null);
|
||||
Assert.IsFalse(_ConfigurationRoot is null);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodArchive()
|
||||
{
|
||||
Assert.IsFalse(_Logger is null);
|
||||
Assert.IsFalse(_AppSettings is null);
|
||||
Assert.IsFalse(_WorkingDirectory is null);
|
||||
Assert.IsFalse(_ConfigurationRoot is null);
|
||||
|
||||
}
|
||||
|
||||
}
|
52
Tests/UnitTestExample.cs
Normal file
52
Tests/UnitTestExample.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using System.Reflection;
|
||||
using OI.Metrology.Tests.Models;
|
||||
using OI.Metrology.Shared.Models;
|
||||
|
||||
namespace View_by_Distance.Tests;
|
||||
|
||||
[TestClass]
|
||||
public class UnitTestExample
|
||||
{
|
||||
|
||||
private readonly ILogger _Logger;
|
||||
private readonly AppSettings _AppSettings;
|
||||
private readonly string _WorkingDirectory;
|
||||
private readonly IConfigurationRoot _ConfigurationRoot;
|
||||
|
||||
public UnitTestExample()
|
||||
{
|
||||
ILogger logger;
|
||||
AppSettings appSettings;
|
||||
string workingDirectory;
|
||||
IConfigurationRoot configurationRoot;
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.Development.json");
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = OI.Metrology.Tests.Models.Stateless.AppSettings.Get(configurationRoot);
|
||||
workingDirectory = IWorkingDirectory.GetWorkingDirectory(assembly.GetName().Name, appSettings.WorkingDirectoryName);
|
||||
Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
|
||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, configurationRoot);
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
logger = Log.ForContext<UnitTestExample>();
|
||||
logger.Information("Complete");
|
||||
_Logger = logger;
|
||||
_AppSettings = appSettings;
|
||||
_WorkingDirectory = workingDirectory;
|
||||
_ConfigurationRoot = configurationRoot;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodNull()
|
||||
{
|
||||
Assert.IsFalse(_Logger is null);
|
||||
Assert.IsFalse(_AppSettings is null);
|
||||
Assert.IsFalse(_WorkingDirectory is null);
|
||||
Assert.IsFalse(_ConfigurationRoot is null);
|
||||
}
|
||||
|
||||
}
|
1
Tests/Usings.cs
Normal file
1
Tests/Usings.cs
Normal file
@ -0,0 +1 @@
|
||||
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
60
Tests/appsettings.Development.json
Normal file
60
Tests/appsettings.Development.json
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"AllowedHosts": "*",
|
||||
"ApiLoggingContentTypes": "application/json",
|
||||
"ApiLoggingPathPrefixes": "/api/inbound",
|
||||
"ApiLogPath": "D:\\Metrology\\MetrologyAPILogs",
|
||||
"AttachmentPath": "\\\\messv02ecc1.ec.local\\EC_Metrology_Si\\MetrologyAttachments",
|
||||
"BuildNumber": "1",
|
||||
"Company": "Infineon Technologies Americas Corp.",
|
||||
"ConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology_Archive;",
|
||||
"GitCommitSeven": "1234567",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"InboundApiAllowedIPList": "",
|
||||
"OIExportPath": "\\\\openinsight-db-srv.na.infineon.com\\apps\\Metrology\\Data",
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"URLs": "https://localhost:7130;http://localhost:5126",
|
||||
"WorkingDirectoryName": "IFXApps"
|
||||
}
|
60
Tests/appsettings.json
Normal file
60
Tests/appsettings.json
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"AllowedHosts": "*",
|
||||
"ApiLoggingContentTypes": "application/json",
|
||||
"ApiLoggingPathPrefixes": "/api/inbound",
|
||||
"ApiLogPath": "D:\\Metrology\\MetrologyAPILogs",
|
||||
"AttachmentPath": "\\\\messv02ecc1.ec.local\\EC_Metrology_Si\\MetrologyAttachments",
|
||||
"BuildNumber": "1",
|
||||
"Company": "Infineon Technologies Americas Corp.",
|
||||
"ConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology_Archive;",
|
||||
"GitCommitSeven": "1234567",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"InboundApiAllowedIPList": "",
|
||||
"OIExportPath": "\\\\openinsight-db-srv.na.infineon.com\\apps\\Metrology\\Data",
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"URLs": "http://localhost:5002;",
|
||||
"WorkingDirectoryName": "IFXApps"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user