Fix outdated tag (#548)

* Fix outdated tag

* Replace logmode and rotate with log and roll

* Fix typo

* Fix quotes

* Fix quotes
pull/554/head
Daniel 2020-06-23 10:15:03 +08:00 committed by GitHub
parent 58d45e32eb
commit d18c5b237c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 28 additions and 28 deletions

View File

@ -21,7 +21,7 @@ The extension can be configured via the [XML configuration file](../xmlConfigFil
<description>This is a stub service.</description> <description>This is a stub service.</description>
<executable>%BASE%\sleep.bat</executable> <executable>%BASE%\sleep.bat</executable>
<arguments></arguments> <arguments></arguments>
<logmode>rotate</logmode> <log mode="roll"></log>
<extensions> <extensions>
<!-- This is a sample configuration for the RunawayProcessKiller extension. --> <!-- This is a sample configuration for the RunawayProcessKiller extension. -->

View File

@ -20,7 +20,7 @@ Configuration sample:
<description>This is a stub service.</description> <description>This is a stub service.</description>
<executable>%BASE%\sleep.bat</executable> <executable>%BASE%\sleep.bat</executable>
<arguments></arguments> <arguments></arguments>
<logmode>rotate</logmode> <log mode="roll"></log>
<extensions> <extensions>
<extension enabled="true" className="winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper" id="mapNetworDirs"> <extension enabled="true" className="winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper" id="mapNetworDirs">

View File

@ -29,7 +29,7 @@ The example below is a primitive example being used in the Jenkins project:
<env name="JENKINS_HOME" value="%BASE%"/> <env name="JENKINS_HOME" value="%BASE%"/>
<executable>java</executable> <executable>java</executable>
<arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments> <arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
<logmode>rotate</logmode> <log mode="roll"></log>
</service> </service>
``` ```

View File

@ -32,9 +32,9 @@ Throw away stdout and stderr, and do not produce any log files at all.
<log mode="none"/> <log mode="none"/>
``` ```
## 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 `<sizeThreshold>` element specifies the rotation threshold in KB (defaults to 10MB), and the nested `<keepFiles>` 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 `<sizeThreshold>` element specifies the rotation threshold in KB (defaults to 10MB), and the nested `<keepFiles>` element specifies the number of rolled files to keep (defaults to 8.)
```xml ```xml
<log mode="roll-by-size"> <log mode="roll-by-size">
@ -43,9 +43,9 @@ Works like the append mode, but in addition, if the log file gets bigger than a
</log> </log>
``` ```
## 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 `<pattern>` element, which specifies the timestamp pattern used as the log file name. This configuration must accompany a nested `<pattern>` element, which specifies the timestamp pattern used as the log file name.
@ -58,9 +58,9 @@ This configuration must accompany a nested `<pattern>` 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_). 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`. 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 `<pattern>` 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 `<pattern>` provided.
```xml ```xml
<log mode="roll-by-size-time"> <log mode="roll-by-size-time">

View File

@ -19,7 +19,7 @@ Example:
<env name="JENKINS_HOME" value="%BASE%"/> <env name="JENKINS_HOME" value="%BASE%"/>
<executable>java</executable> <executable>java</executable>
<arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments> <arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
<logmode>rotate</logmode> <log mode="roll"></log>
</service> </service>
``` ```
@ -88,7 +88,7 @@ Multiple elements can be used to specify multiple dependencies.
### logging ### logging
Optionally set a different logging directory with `<logpath>` and startup `<logmode>`: reset (clear log), roll (move to \*.old) or append (default). Optionally set a different logging directory with `<logpath>` 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. See the [Logging and error reporting](loggingAndErrorReporting.md) page for more info.

View File

@ -231,8 +231,8 @@ SECTION:Logging
* append - Rust update the existing log * append - Rust update the existing log
* none - Do not save executable logs to the disk * none - Do not save executable logs to the disk
* reset - Wipe the log files on startup * reset - Wipe the log files on startup
* roll - Rotate logs based on size * roll - Roll logs based on size
* roll-by-time - Rotate logs based on time * roll-by-time - Roll logs based on time
* rotate - Rotate logs based on size, (8 logs, 10MB each). This mode is deprecated, use "roll" * rotate - Rotate logs based on size, (8 logs, 10MB each). This mode is deprecated, use "roll"
Default mode: append Default mode: append

View File

@ -222,7 +222,7 @@ namespace winsw
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static int BYTES_PER_MB = 1024 * BYTES_PER_KB; public static int BYTES_PER_MB = 1024 * BYTES_PER_KB;
// ReSharper disable once InconsistentNaming // 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 // ReSharper disable once InconsistentNaming
public static int DEFAULT_FILES_TO_KEEP = 8; public static int DEFAULT_FILES_TO_KEEP = 8;
@ -283,11 +283,11 @@ namespace winsw
} }
catch (IOException e) 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 // 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)); writer = CreateWriter(new FileStream(BaseLogFileName + ext, FileMode.Create));
fileLength = new FileInfo(BaseLogFileName + ext).Length; fileLength = new FileInfo(BaseLogFileName + ext).Length;
} }
@ -302,7 +302,7 @@ namespace winsw
} }
/// <summary> /// <summary>
/// Rotate log when a service is newly started. /// Roll log when a service is newly started.
/// </summary> /// </summary>
public class RollingLogAppender : SimpleLogAppender public class RollingLogAppender : SimpleLogAppender
{ {
@ -426,7 +426,7 @@ namespace winsw
{ {
try try
{ {
// rotate file // roll file
var now = DateTime.Now; var now = DateTime.Now;
var nextFileNumber = GetNextFileNumber(extension, baseDirectory, baseFileName, now); var nextFileNumber = GetNextFileNumber(extension, baseDirectory, baseFileName, now);
var nextFileName = var nextFileName =
@ -435,7 +435,7 @@ namespace winsw
File.Move(logFile, nextFileName); File.Move(logFile, nextFileName);
// even if the log rotation fails, create a new one, or else // 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)); writer = CreateWriter(new FileStream(logFile, FileMode.Create));
fileLength = new FileInfo(logFile).Length; fileLength = new FileInfo(logFile).Length;
} }

View File

@ -5,7 +5,7 @@
<description>This service runs a slave for Jenkins continuous integration system.</description> <description>This service runs a slave for Jenkins continuous integration system.</description>
<executable>C:\Program Files\Java\jre7\bin\java.exe</executable> <executable>C:\Program Files\Java\jre7\bin\java.exe</executable>
<arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl ...</arguments> <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl ...</arguments>
<logmode>rotate</logmode> <log mode="roll"></log>
<extensions> <extensions>
<!-- This is a sample configuration for the RunawayProcessKiller extension. --> <!-- This is a sample configuration for the RunawayProcessKiller extension. -->

View File

@ -5,7 +5,7 @@
<description>This service runs a slave for Jenkins continuous integration system.</description> <description>This service runs a slave for Jenkins continuous integration system.</description>
<executable>C:\Program Files\Java\jre7\bin\java.exe</executable> <executable>C:\Program Files\Java\jre7\bin\java.exe</executable>
<arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl ...</arguments> <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl ...</arguments>
<logmode>rotate</logmode> <log mode="roll"></log>
<extensions> <extensions>
<extension enabled="true" className="winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper" id="mapNetworDirs"> <extension enabled="true" className="winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper" id="mapNetworDirs">

View File

@ -28,7 +28,7 @@ $@"<service>
<description>This service runs a slave for Jenkins continuous integration system.</description> <description>This service runs a slave for Jenkins continuous integration system.</description>
<executable>C:\Program Files\Java\jre7\bin\java.exe</executable> <executable>C:\Program Files\Java\jre7\bin\java.exe</executable>
<arguments>-Xrs -jar \""%BASE%\slave.jar\"" -jnlpUrl ...</arguments> <arguments>-Xrs -jar \""%BASE%\slave.jar\"" -jnlpUrl ...</arguments>
<logmode>rotate</logmode> <log mode=""roll""></log>
<extensions> <extensions>
<extension enabled=""true"" className=""{testExtension}"" id=""killRunawayProcess""> <extension enabled=""true"" className=""{testExtension}"" id=""killRunawayProcess"">
<pidfile>foo/bar/pid.txt</pidfile> <pidfile>foo/bar/pid.txt</pidfile>

View File

@ -22,7 +22,7 @@ $@"<service>
<description>This service runs a slave for Jenkins continuous integration system.</description> <description>This service runs a slave for Jenkins continuous integration system.</description>
<executable>C:\Program Files\Java\jre7\bin\java.exe</executable> <executable>C:\Program Files\Java\jre7\bin\java.exe</executable>
<arguments>-Xrs -jar \""%BASE%\slave.jar\"" -jnlpUrl ...</arguments> <arguments>-Xrs -jar \""%BASE%\slave.jar\"" -jnlpUrl ...</arguments>
<logmode>rotate</logmode> <log mode=""roll""></log>
<extensions> <extensions>
<extension enabled=""true"" className=""{testExtension}"" id=""mapNetworDirs""> <extension enabled=""true"" className=""{testExtension}"" id=""mapNetworDirs"">
<mapping> <mapping>

View File

@ -28,7 +28,7 @@ $@"<service>
<description>The service.</description> <description>The service.</description>
<executable>node.exe</executable> <executable>node.exe</executable>
<arguments>My Arguments</arguments> <arguments>My Arguments</arguments>
<logmode>rotate</logmode> <log mode=""roll""></log>
<serviceaccount> <serviceaccount>
<domain>{Domain}</domain> <domain>{Domain}</domain>
<user>{Username}</user> <user>{Username}</user>
@ -57,8 +57,8 @@ $@"<service>
<description>The service.</description> <description>The service.</description>
<executable>node.exe</executable> <executable>node.exe</executable>
<arguments>My Arguments</arguments> <arguments>My Arguments</arguments>
<startmode>rotate</startmode> <startmode>roll</startmode>
<logmode>rotate</logmode> <log mode=""roll""></log>
<serviceaccount> <serviceaccount>
<domain>{Domain}</domain> <domain>{Domain}</domain>
<user>{Username}</user> <user>{Username}</user>
@ -84,7 +84,7 @@ $@"<service>
<executable>node.exe</executable> <executable>node.exe</executable>
<arguments>My Arguments</arguments> <arguments>My Arguments</arguments>
<startmode>manual</startmode> <startmode>manual</startmode>
<logmode>rotate</logmode> <log mode=""roll""></log>
<serviceaccount> <serviceaccount>
<domain>{Domain}</domain> <domain>{Domain}</domain>
<user>{Username}</user> <user>{Username}</user>

View File

@ -20,7 +20,7 @@ $@"<service>
<description>The service.</description> <description>The service.</description>
<executable>node.exe</executable> <executable>node.exe</executable>
<arguments>My Arguments</arguments> <arguments>My Arguments</arguments>
<logmode>rotate</logmode> <log mode=""roll""></log>
<workingdirectory>C:\winsw\workdir</workingdirectory> <workingdirectory>C:\winsw\workdir</workingdirectory>
<logpath>C:\winsw\logs</logpath> <logpath>C:\winsw\logs</logpath>
</service>"; </service>";