Fix yaml `logPath` case

pull/1039/head
Guillaume CHAUVEL 2023-06-12 15:31:38 +02:00
parent 6cf303c1d3
commit bbf09132e7
3 changed files with 15 additions and 7 deletions

View File

@ -96,14 +96,14 @@ depend:
### log
Optionally set a different logging directory with `logpath` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`).
Optionally set a different logging directory with `logPath` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`).
User can specify all log configurations as a single YAML dictionary
```yaml
log:
mode: roll-by-size
logpath: '%BASE%\log'
logPath: '%BASE%\log'
sizeThreshold: 10240
keepFiles: 8
```

View File

@ -38,7 +38,7 @@ waitHint: 15 sec
sleepTime: 1 sec
#interactive: true
log:
# logpath: '%BASE%\logs'
# logPath: '%BASE%\logs'
mode: append
#env:
# -

View File

@ -12,6 +12,7 @@ namespace winswTests
private IServiceConfig _extendedServiceDescriptor;
private const string ExpectedWorkingDirectory = @"Z:\Path\SubPath";
private const string ExpectedLogDirectory = @"c:\logs";
private const string Username = "User";
private const string Password = "Password";
private const string Domain = "Domain";
@ -29,7 +30,7 @@ executable: node.exe
arguments: My Arguments
log:
mode: roll
logpath: c:\logs
logPath: {ExpectedLogDirectory}
serviceAccount:
domain: {Domain}
user: {Username}
@ -82,6 +83,13 @@ startMode: manual";
Assert.That(this._extendedServiceDescriptor.WorkingDirectory, Is.EqualTo(ExpectedWorkingDirectory));
}
[Test]
public void VerifyLogPath()
{
Assert.That(this._extendedServiceDescriptor.Log.Directory, Is.EqualTo(ExpectedLogDirectory));
Assert.That(this._extendedServiceDescriptor.LogDirectory, Is.EqualTo(ExpectedLogDirectory));
}
[Test]
public void VerifyServiceLogonRight()
{
@ -265,7 +273,7 @@ name: Service
description: The Service.
executable: node.exe
log:
logpath: 'c:\\'
logPath: 'c:\\'
mode: roll-by-size
sizeThreshold: 112
keepFiles: 113";
@ -289,7 +297,7 @@ name: Service
description: The Service.
executable: node.exe
log:
logpath: c:\\
logPath: c:\\
mode: roll-by-time
period: 7
pattern: log pattern";
@ -313,7 +321,7 @@ name: Service
description: The Service.
executable: node.exe
log:
logpath: c:\\
logPath: c:\\
mode: roll-by-size-time
sizeThreshold: 10240
pattern: yyyy-MM-dd