Skip to content
Snippets Groups Projects
Commit 856d8e10 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Reverse components in log file names to start with the host name

Refers to #5
parent 3d0d81c5
No related branches found
No related tags found
No related merge requests found
......@@ -157,9 +157,9 @@ namespace ATxService
var logConfig = new LoggingConfiguration();
var fileTarget = new FileTarget {
Name = "file",
FileName = $"var/{ServiceName}.{Environment.MachineName}.log",
FileName = $"var/{Environment.MachineName}.{ServiceName}.log",
ArchiveAboveSize = 1 * Conv.MegaBytes,
ArchiveFileName = $"var/{ServiceName}.{Environment.MachineName}" + ".{#}.log",
ArchiveFileName = $"var/{Environment.MachineName}.{ServiceName}" + ".{#}.log",
MaxArchiveFiles = 9,
KeepFileOpen = true,
Layout = LogFormatDefault,
......
......@@ -24,7 +24,7 @@ namespace ATxService
var startupLog = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"var",
"startup.log");
$"{Environment.MachineName}.startup.log");
using (var sw = File.AppendText(startupLog))
{
sw.WriteLine(ex.Message);
......
......@@ -93,7 +93,7 @@ if (Test-Path $LocalConfiguration) {
Exit
}
$ServiceLog = "$($ServiceDir)\$($ServiceName).log"
$ServiceLog = "$($ServiceDir)\var\$($env:COMPUTERNAME).$($ServiceName).log"
$Service = Get-Service $ServiceName -ErrorAction SilentlyContinue
......
......@@ -6,7 +6,7 @@ if (Test-Path $LocalConfiguration) {
Exit
}
$LogFile = "$($ServiceDir)\var\$($ServiceName).$($env:COMPUTERNAME).log"
$LogFile = "$($ServiceDir)\var\$($env:COMPUTERNAME).$($ServiceName).log"
if (Test-Path $LogFile) {
Write-Host "Watching logfile '$LogFile':"
......
......@@ -617,7 +617,7 @@ $ServiceRunningBefore = ServiceIsRunning $ServiceName
$ConfigPath = "$($InstallationPath)\conf"
$LogPath = "$($InstallationPath)\var"
$LogFilePfx = "$($LogPath)\$($ServiceName).$($env:COMPUTERNAME)"
$LogFilePfx = "$($LogPath)\$($env:COMPUTERNAME).$($ServiceName)"
$StatusXml = "$($InstallationPath)\var\status.xml"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment