diff --git a/APC Viewer/Pages/Background.cshtml b/APC Viewer/Pages/Background.cshtml
index 4b5275b..a23d507 100644
--- a/APC Viewer/Pages/Background.cshtml
+++ b/APC Viewer/Pages/Background.cshtml
@@ -28,7 +28,7 @@
- - Home
+ - Index.txt
- Background Message
- Background Message Clear
- Background Exceptions Clear
diff --git a/APC Viewer/Singleton/Background.cs b/APC Viewer/Singleton/Background.cs
index bb737f3..02354c0 100644
--- a/APC Viewer/Singleton/Background.cs
+++ b/APC Viewer/Singleton/Background.cs
@@ -42,8 +42,8 @@ public class Background : Models.Properties.IBackground, IBackground
public Background(IFX.Shared.IsEnvironment isEnvironment, AppSettings appSettings, string workingDirectory)
{
_Stop = false;
- _AppSettings = appSettings;
_Message = string.Empty;
+ _AppSettings = appSettings;
_IsEnvironment = isEnvironment;
_Exceptions = new List();
_WorkingDirectory = workingDirectory;
@@ -143,20 +143,35 @@ public class Background : Models.Properties.IBackground, IBackground
public void APCDataCallback()
{
- Data(_AppSettings.Server, _SiEquipmentTypes, _SiAPCLogistics, _SiPDSFFiles, isAPC: true);
- Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNAPCLogistics, _GaNPDSFFiles, isAPC: true);
+ string server;
+ if (_IsEnvironment.Production)
+ server = _AppSettings.Server;
+ else
+ server = _AppSettings.Server.Replace('.', '_');
+ Data(server, _SiEquipmentTypes, _SiAPCLogistics, _SiPDSFFiles, isAPC: true);
+ Data(server, _GaNEquipmentTypes, _GaNAPCLogistics, _GaNPDSFFiles, isAPC: true);
}
public void EDADataCallback()
{
- Data(_AppSettings.Server, _SiEquipmentTypes, _SiEDALogistics, _SiPDSFFiles, isEDA: true);
- Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNEDALogistics, _GaNPDSFFiles, isEDA: true);
+ string server;
+ if (_IsEnvironment.Production)
+ server = _AppSettings.Server;
+ else
+ server = _AppSettings.Server.Replace('.', '_');
+ Data(server, _SiEquipmentTypes, _SiEDALogistics, _SiPDSFFiles, isEDA: true);
+ Data(server, _GaNEquipmentTypes, _GaNEDALogistics, _GaNPDSFFiles, isEDA: true);
}
public void EAFLogDataCallback()
{
- Data(_AppSettings.Server, _SiEquipmentTypes, _SiEAFLogLogistics, _SiIPDSFFiles, isEAFLog: true);
- Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNEAFLogLogistics, _GaNIPDSFFiles, isEAFLog: true);
+ string server;
+ if (_IsEnvironment.Production)
+ server = _AppSettings.Server;
+ else
+ server = _AppSettings.Server.Replace('.', '_');
+ Data(server, _SiEquipmentTypes, _SiEAFLogLogistics, _SiIPDSFFiles, isEAFLog: true);
+ Data(server, _GaNEquipmentTypes, _GaNEAFLogLogistics, _GaNIPDSFFiles, isEAFLog: true);
}
public string GetPDSF(long Sequence)
diff --git a/APC Viewer/appsettings.Development.json b/APC Viewer/appsettings.Development.json
index a6fc990..979de27 100644
--- a/APC Viewer/appsettings.Development.json
+++ b/APC Viewer/appsettings.Development.json
@@ -138,6 +138,43 @@
}
},
"MonARessource": "APC_Viewer_EC",
+ "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"
+ }
+ },
"Server": "messv02ecc1.ec.local",
"ServiceUser": "mesapcsvc",
"URLs": "http://localhost:5002;",
diff --git a/APC Viewer/appsettings.Staging.json b/APC Viewer/appsettings.Staging.json
index 11db9d6..2a26582 100644
--- a/APC Viewer/appsettings.Staging.json
+++ b/APC Viewer/appsettings.Staging.json
@@ -138,6 +138,43 @@
}
},
"MonARessource": "APC_Viewer_EC",
+ "Serilog": {
+ "Using": [
+ "Serilog.Sinks.Console",
+ "Serilog.Sinks.File"
+ ],
+ "MinimumLevel": "Information",
+ "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"
+ }
+ },
"Server": "messv02ecc1.ec.local",
"ServiceUser": "ECAPCSvc",
"URLs": "http://localhost:5002;",
diff --git a/APC Viewer/appsettings.json b/APC Viewer/appsettings.json
index 11db9d6..2a26582 100644
--- a/APC Viewer/appsettings.json
+++ b/APC Viewer/appsettings.json
@@ -138,6 +138,43 @@
}
},
"MonARessource": "APC_Viewer_EC",
+ "Serilog": {
+ "Using": [
+ "Serilog.Sinks.Console",
+ "Serilog.Sinks.File"
+ ],
+ "MinimumLevel": "Information",
+ "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"
+ }
+ },
"Server": "messv02ecc1.ec.local",
"ServiceUser": "ECAPCSvc",
"URLs": "http://localhost:5002;",