Serilog Config
This commit is contained in:
parent
289547180a
commit
8d039fc41d
@ -28,7 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/">Home</a></li>
|
<li><a href="/Index.txt">Index.txt</a></li>
|
||||||
<li><a href="/Background">Background Message</a></li>
|
<li><a href="/Background">Background Message</a></li>
|
||||||
<li><a href="/Background/?message_clear=true">Background Message Clear</a></li>
|
<li><a href="/Background/?message_clear=true">Background Message Clear</a></li>
|
||||||
<li><a href="/Background/?exceptions_clear=true">Background Exceptions Clear</a></li>
|
<li><a href="/Background/?exceptions_clear=true">Background Exceptions Clear</a></li>
|
||||||
|
@ -42,8 +42,8 @@ public class Background : Models.Properties.IBackground, IBackground
|
|||||||
public Background(IFX.Shared.IsEnvironment isEnvironment, AppSettings appSettings, string workingDirectory)
|
public Background(IFX.Shared.IsEnvironment isEnvironment, AppSettings appSettings, string workingDirectory)
|
||||||
{
|
{
|
||||||
_Stop = false;
|
_Stop = false;
|
||||||
_AppSettings = appSettings;
|
|
||||||
_Message = string.Empty;
|
_Message = string.Empty;
|
||||||
|
_AppSettings = appSettings;
|
||||||
_IsEnvironment = isEnvironment;
|
_IsEnvironment = isEnvironment;
|
||||||
_Exceptions = new List<Exception>();
|
_Exceptions = new List<Exception>();
|
||||||
_WorkingDirectory = workingDirectory;
|
_WorkingDirectory = workingDirectory;
|
||||||
@ -143,20 +143,35 @@ public class Background : Models.Properties.IBackground, IBackground
|
|||||||
|
|
||||||
public void APCDataCallback()
|
public void APCDataCallback()
|
||||||
{
|
{
|
||||||
Data(_AppSettings.Server, _SiEquipmentTypes, _SiAPCLogistics, _SiPDSFFiles, isAPC: true);
|
string server;
|
||||||
Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNAPCLogistics, _GaNPDSFFiles, isAPC: true);
|
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()
|
public void EDADataCallback()
|
||||||
{
|
{
|
||||||
Data(_AppSettings.Server, _SiEquipmentTypes, _SiEDALogistics, _SiPDSFFiles, isEDA: true);
|
string server;
|
||||||
Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNEDALogistics, _GaNPDSFFiles, isEDA: true);
|
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()
|
public void EAFLogDataCallback()
|
||||||
{
|
{
|
||||||
Data(_AppSettings.Server, _SiEquipmentTypes, _SiEAFLogLogistics, _SiIPDSFFiles, isEAFLog: true);
|
string server;
|
||||||
Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNEAFLogLogistics, _GaNIPDSFFiles, isEAFLog: true);
|
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)
|
public string GetPDSF(long Sequence)
|
||||||
|
@ -138,6 +138,43 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonARessource": "APC_Viewer_EC",
|
"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",
|
"Server": "messv02ecc1.ec.local",
|
||||||
"ServiceUser": "mesapcsvc",
|
"ServiceUser": "mesapcsvc",
|
||||||
"URLs": "http://localhost:5002;",
|
"URLs": "http://localhost:5002;",
|
||||||
|
@ -138,6 +138,43 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonARessource": "APC_Viewer_EC",
|
"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",
|
"Server": "messv02ecc1.ec.local",
|
||||||
"ServiceUser": "ECAPCSvc",
|
"ServiceUser": "ECAPCSvc",
|
||||||
"URLs": "http://localhost:5002;",
|
"URLs": "http://localhost:5002;",
|
||||||
|
@ -138,6 +138,43 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonARessource": "APC_Viewer_EC",
|
"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",
|
"Server": "messv02ecc1.ec.local",
|
||||||
"ServiceUser": "ECAPCSvc",
|
"ServiceUser": "ECAPCSvc",
|
||||||
"URLs": "http://localhost:5002;",
|
"URLs": "http://localhost:5002;",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user