From d18c5b237cd3295673f0796f0535a82f77ec199e Mon Sep 17 00:00:00 2001 From: Daniel <44944011+DanielW10001@users.noreply.github.com> Date: Tue, 23 Jun 2020 10:15:03 +0800 Subject: [PATCH] Fix outdated tag (#548) * Fix outdated tag * Replace logmode and rotate with log and roll * Fix typo * Fix quotes * Fix quotes --- doc/extensions/runawayProcessKiller.md | 2 +- doc/extensions/sharedDirectoryMapper.md | 2 +- doc/installation.md | 2 +- doc/loggingAndErrorReporting.md | 12 ++++++------ doc/xmlConfigFile.md | 4 ++-- examples/sample-allOptions.xml | 4 ++-- src/Core/WinSWCore/LogAppenders.cs | 12 ++++++------ src/Plugins/RunawayProcessKiller/sampleConfig.xml | 2 +- src/Plugins/SharedDirectoryMapper/sampleConfig.xml | 2 +- .../Extensions/RunawayProcessKillerTest.cs | 2 +- .../Extensions/SharedDirectoryMapperTest.cs | 2 +- src/Test/winswTests/ServiceDescriptorTests.cs | 8 ++++---- src/Test/winswTests/Util/CLITestHelper.cs | 2 +- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/extensions/runawayProcessKiller.md b/doc/extensions/runawayProcessKiller.md index f5889ff..5b6d045 100644 --- a/doc/extensions/runawayProcessKiller.md +++ b/doc/extensions/runawayProcessKiller.md @@ -21,7 +21,7 @@ The extension can be configured via the [XML configuration file](../xmlConfigFil This is a stub service. %BASE%\sleep.bat - rotate + diff --git a/doc/extensions/sharedDirectoryMapper.md b/doc/extensions/sharedDirectoryMapper.md index 46001a3..d91f26b 100644 --- a/doc/extensions/sharedDirectoryMapper.md +++ b/doc/extensions/sharedDirectoryMapper.md @@ -20,7 +20,7 @@ Configuration sample: This is a stub service. %BASE%\sleep.bat - rotate + diff --git a/doc/installation.md b/doc/installation.md index 32625cd..69234b1 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -29,7 +29,7 @@ The example below is a primitive example being used in the Jenkins project: java -Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080 - rotate + ``` diff --git a/doc/loggingAndErrorReporting.md b/doc/loggingAndErrorReporting.md index 027f21f..118a176 100644 --- a/doc/loggingAndErrorReporting.md +++ b/doc/loggingAndErrorReporting.md @@ -32,9 +32,9 @@ Throw away stdout and stderr, and do not produce any log files at all. ``` -## Rotate mode +## Roll mode -Works like the append mode, but in addition, if the log file gets bigger than a set size, it gets rotated to *myapp.1.out.log*, *myapp.2.out.log* and so on. The nested `` element specifies the rotation threshold in KB (defaults to 10MB), and the nested `` element specifies the number of rotated files to keep (defaults to 8.) +Works like the append mode, but in addition, if the log file gets bigger than a set size, it gets rolled to *myapp.1.out.log*, *myapp.2.out.log* and so on. The nested `` element specifies the rotation threshold in KB (defaults to 10MB), and the nested `` element specifies the number of rolled files to keep (defaults to 8.) ```xml @@ -43,9 +43,9 @@ Works like the append mode, but in addition, if the log file gets bigger than a ``` -## Rotate by time mode +## Roll by time mode -Works like the rotate mode, except that instead of using the size as a threshold, use the time period as the threshold. +Works like the roll mode, except that instead of using the size as a threshold, use the time period as the threshold. This configuration must accompany a nested `` element, which specifies the timestamp pattern used as the log file name. @@ -58,9 +58,9 @@ This configuration must accompany a nested `` element, which specifies The syntax of the pattern string is specified by [DateTime.ToString(String)](https://docs.microsoft.com/dotnet/api/system.datetime.tostring#System_DateTime_ToString_System_String_). For example, in the above example, the log of Jan 1, 2013 gets written to `myapp.20130101.out.log` and `myapp.20130101.err.log`. -## Rotate by size and time mode +## Roll by size and time mode -Works in a combination of rotate size mode and rotate time mode, if the log file gets bigger than a set size, it gets rotated using `` provided. +Works in a combination of roll size mode and roll time mode, if the log file gets bigger than a set size, it gets rolled using `` provided. ```xml diff --git a/doc/xmlConfigFile.md b/doc/xmlConfigFile.md index e843f3a..6799c0c 100644 --- a/doc/xmlConfigFile.md +++ b/doc/xmlConfigFile.md @@ -19,7 +19,7 @@ Example: java -Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080 - rotate + ``` @@ -88,7 +88,7 @@ Multiple elements can be used to specify multiple dependencies. ### logging -Optionally set a different logging directory with `` and startup ``: reset (clear log), roll (move to \*.old) or append (default). +Optionally set a different logging directory with `` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`). See the [Logging and error reporting](loggingAndErrorReporting.md) page for more info. diff --git a/examples/sample-allOptions.xml b/examples/sample-allOptions.xml index dc87cc2..f02ae6a 100644 --- a/examples/sample-allOptions.xml +++ b/examples/sample-allOptions.xml @@ -231,8 +231,8 @@ SECTION:Logging * append - Rust update the existing log * none - Do not save executable logs to the disk * reset - Wipe the log files on startup - * roll - Rotate logs based on size - * roll-by-time - Rotate logs based on time + * roll - Roll logs based on size + * roll-by-time - Roll logs based on time * rotate - Rotate logs based on size, (8 logs, 10MB each). This mode is deprecated, use "roll" Default mode: append diff --git a/src/Core/WinSWCore/LogAppenders.cs b/src/Core/WinSWCore/LogAppenders.cs index a78140d..855c4a1 100644 --- a/src/Core/WinSWCore/LogAppenders.cs +++ b/src/Core/WinSWCore/LogAppenders.cs @@ -222,7 +222,7 @@ namespace winsw // ReSharper disable once InconsistentNaming public static int BYTES_PER_MB = 1024 * BYTES_PER_KB; // ReSharper disable once InconsistentNaming - public static int DEFAULT_SIZE_THRESHOLD = 10 * BYTES_PER_MB; // rotate every 10MB. + public static int DEFAULT_SIZE_THRESHOLD = 10 * BYTES_PER_MB; // roll every 10MB. // ReSharper disable once InconsistentNaming public static int DEFAULT_FILES_TO_KEEP = 8; @@ -283,11 +283,11 @@ namespace winsw } catch (IOException e) { - EventLogger.LogEvent("Failed to rotate log: " + e.Message); + EventLogger.LogEvent("Failed to roll log: " + e.Message); } // even if the log rotation fails, create a new one, or else - // we'll infinitely try to rotate. + // we'll infinitely try to roll. writer = CreateWriter(new FileStream(BaseLogFileName + ext, FileMode.Create)); fileLength = new FileInfo(BaseLogFileName + ext).Length; } @@ -302,7 +302,7 @@ namespace winsw } /// - /// Rotate log when a service is newly started. + /// Roll log when a service is newly started. /// public class RollingLogAppender : SimpleLogAppender { @@ -426,7 +426,7 @@ namespace winsw { try { - // rotate file + // roll file var now = DateTime.Now; var nextFileNumber = GetNextFileNumber(extension, baseDirectory, baseFileName, now); var nextFileName = @@ -435,7 +435,7 @@ namespace winsw File.Move(logFile, nextFileName); // even if the log rotation fails, create a new one, or else - // we'll infinitely try to rotate. + // we'll infinitely try to roll. writer = CreateWriter(new FileStream(logFile, FileMode.Create)); fileLength = new FileInfo(logFile).Length; } diff --git a/src/Plugins/RunawayProcessKiller/sampleConfig.xml b/src/Plugins/RunawayProcessKiller/sampleConfig.xml index 24514bd..c138f02 100644 --- a/src/Plugins/RunawayProcessKiller/sampleConfig.xml +++ b/src/Plugins/RunawayProcessKiller/sampleConfig.xml @@ -5,7 +5,7 @@ This service runs a slave for Jenkins continuous integration system. C:\Program Files\Java\jre7\bin\java.exe -Xrs -jar "%BASE%\slave.jar" -jnlpUrl ... - rotate + diff --git a/src/Plugins/SharedDirectoryMapper/sampleConfig.xml b/src/Plugins/SharedDirectoryMapper/sampleConfig.xml index 5a2eb1a..8a6392d 100644 --- a/src/Plugins/SharedDirectoryMapper/sampleConfig.xml +++ b/src/Plugins/SharedDirectoryMapper/sampleConfig.xml @@ -5,7 +5,7 @@ This service runs a slave for Jenkins continuous integration system. C:\Program Files\Java\jre7\bin\java.exe -Xrs -jar "%BASE%\slave.jar" -jnlpUrl ... - rotate + diff --git a/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs b/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs index 64585c6..007cf67 100644 --- a/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs +++ b/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs @@ -28,7 +28,7 @@ $@" This service runs a slave for Jenkins continuous integration system. C:\Program Files\Java\jre7\bin\java.exe -Xrs -jar \""%BASE%\slave.jar\"" -jnlpUrl ... - rotate + foo/bar/pid.txt diff --git a/src/Test/winswTests/Extensions/SharedDirectoryMapperTest.cs b/src/Test/winswTests/Extensions/SharedDirectoryMapperTest.cs index 3962c69..28b227e 100644 --- a/src/Test/winswTests/Extensions/SharedDirectoryMapperTest.cs +++ b/src/Test/winswTests/Extensions/SharedDirectoryMapperTest.cs @@ -22,7 +22,7 @@ $@" This service runs a slave for Jenkins continuous integration system. C:\Program Files\Java\jre7\bin\java.exe -Xrs -jar \""%BASE%\slave.jar\"" -jnlpUrl ... - rotate + diff --git a/src/Test/winswTests/ServiceDescriptorTests.cs b/src/Test/winswTests/ServiceDescriptorTests.cs index 1b39f17..aacfd17 100644 --- a/src/Test/winswTests/ServiceDescriptorTests.cs +++ b/src/Test/winswTests/ServiceDescriptorTests.cs @@ -28,7 +28,7 @@ $@" The service. node.exe My Arguments - rotate + {Domain} {Username} @@ -57,8 +57,8 @@ $@" The service. node.exe My Arguments - rotate - rotate + roll + {Domain} {Username} @@ -84,7 +84,7 @@ $@" node.exe My Arguments manual - rotate + {Domain} {Username} diff --git a/src/Test/winswTests/Util/CLITestHelper.cs b/src/Test/winswTests/Util/CLITestHelper.cs index 4811341..a338f7b 100644 --- a/src/Test/winswTests/Util/CLITestHelper.cs +++ b/src/Test/winswTests/Util/CLITestHelper.cs @@ -20,7 +20,7 @@ $@" The service. node.exe My Arguments - rotate + C:\winsw\workdir C:\winsw\logs ";