You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

131 lines
6.1 KiB

using NLog.Targets;
namespace Mirle.Component.Record
{
/// <summary>
/// 記錄檔格式類別
/// </summary>
public static class FileLayout
{
/// <summary>
/// 微服物平台主程式記錄檔格式
/// </summary>
public static readonly FileTarget MicroServicePlatformFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/MicroServicePlatform.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/MicroServicePlatform.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 倉儲執行系統主程式記錄檔格式
/// </summary>
public static readonly FileTarget WarehouseExecutionSystemFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/WarehouseExecutionSystem.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/WarehouseExecutionSystem.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 倉儲控制系統主程式記錄檔格式
/// </summary>
public static readonly FileTarget WarehouseControlSystemFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/WarehouseControlSystem.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/WarehouseControlSystem.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 控制器控制系統主程式記錄檔格式
/// </summary>
public static readonly FileTarget PLCControlerSystemFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/PLCControlerSystem.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/PLCControlerSystem.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 資料交換平台主程式記錄檔格式
/// </summary>
public static readonly FileTarget DataExchangePlatformFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/DataExchangePlatform.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/DataExchangePlatform.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 資料交換平台主程式記錄檔格式
/// </summary>
public static readonly FileTarget WCSProcessFlowFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/Flow.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/Flow.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 錯誤資料紀錄檔格式
/// </summary>
public static readonly FileTarget ErrorDataFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/ErrorData.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/ErrorData.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
/// <summary>
/// 戰情室紀錄檔格式
/// </summary>
public static readonly FileTarget WarRoomFileLayout = new FileTarget()
{
Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
FileName = "${basedir}/Logs/${shortdate}/WarRoom.log",
ArchiveFileName = "${basedir}/archives/${shortdate}/WarRoom.zip",
ArchiveNumbering = ArchiveNumberingMode.Date,
ArchiveDateFormat = "yyyy-MM-dd",
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
KeepFileOpen = true,
MaxArchiveFiles = 7
};
}
}