From 93cbbdf2bc02211b84cd4bacac5d7033ec42aa65 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 11 Sep 2022 17:49:19 +0000 Subject: [PATCH] --- docs/8.0/ayanova/docs/ops-log.md | 17 +++++++++-------- server/AyaNova/Program.cs | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/8.0/ayanova/docs/ops-log.md b/docs/8.0/ayanova/docs/ops-log.md index efd6cc50..6bb18165 100644 --- a/docs/8.0/ayanova/docs/ops-log.md +++ b/docs/8.0/ayanova/docs/ops-log.md @@ -2,8 +2,9 @@ AyaNova logs important events to the file log-ayanova.txt for troubleshooting purposes. -Every Wednesday it archives the current log file to a numbered archive log file, for example log-ayanova-1.txt, log-ayanova-2.txt etc. -Any log older than 4 weeks is deleted permanently; 4 total logs are kept, which means a total of one month of logs are kept at any given time. +The log file is archived when it reaches 1mb in size to a rotating set of 9 numbered archive log files, for example log-ayanova-1.txt, log-ayanova-2.txt etc. + +This means there are a total of 10mb of logs kept at any given time. ## Log path @@ -30,12 +31,12 @@ For example from the command line Below are listed the accepted values for log level from highest to lowest. A level logs everything at that level and above. So, for example, "Trace" level will log the most and "Fatal" will log the least. -- `Fatal` - Critical errors that prevent AyaNova from running or force it to shut down. This setting results in the least amount of logging. -- `Error` - Logs all of the above plus errors that AyaNova can recover from and continue to operate. -- `Warn` - Logs all of the above plus issues that AyaNova can work around but should be looked into and are warnings to system operators. -- `Info` - Default level. Logs all the above levels plus normal behavior in low level of detail. Basic general operations are logged like startup and shutdown, configuration changes etc. -- `Debug` - Logs all the above plus every request to the server in detail and information about internal operations. -- `Trace` - Logs all the above plus highest level detail of internal program code operations. Useful primarily to AyaNova technical support to troubleshoot a specific issue, but too detailed for normal purposes. +- `Fatal` - Critical errors that prevent AyaNova from running or force it to shut down. This setting results in the least amount of logging. +- `Error` - Logs all of the above plus errors that AyaNova can recover from and continue to operate. +- `Warn` - Logs all of the above plus issues that AyaNova can work around but should be looked into and are warnings to system operators. +- `Info` - Default level. Logs all the above levels plus normal behavior in low level of detail. Basic general operations are logged like startup and shutdown, configuration changes etc. +- `Debug` - Logs all the above plus every request to the server in detail and information about internal operations. +- `Trace` - Logs all the above plus highest level detail of internal program code operations. Useful primarily to AyaNova technical support to troubleshoot a specific issue, but too detailed for normal purposes. ## Troubleshooting logging diff --git a/server/AyaNova/Program.cs b/server/AyaNova/Program.cs index 4228c640..64176073 100644 --- a/server/AyaNova/Program.cs +++ b/server/AyaNova/Program.cs @@ -132,9 +132,9 @@ namespace AyaNova fileTarget.FileName = Path.Combine(ServerBootConfig.AYANOVA_LOG_PATH, "log-ayanova.txt"); fileTarget.Layout = "${longdate}|${uppercase:${level}}|${logger}|${message:exceptionSeparator==>:withException=true}"; fileTarget.ArchiveFileName = Path.Combine(ServerBootConfig.AYANOVA_LOG_PATH, "log-ayanova-{#}.txt"); - fileTarget.ArchiveNumbering = ArchiveNumberingMode.Date; - fileTarget.ArchiveEvery = FileArchivePeriod.Wednesday; - fileTarget.MaxArchiveFiles = 3; + fileTarget.ArchiveNumbering = ArchiveNumberingMode.Rolling;//so expect to see 1 to 10 or 0 to ten as may be + fileTarget.ArchiveAboveSize = 1000000;//1mb maximum file size + fileTarget.MaxArchiveFiles = 9;//max 10 files totalling 10mb, the current log-ayanova.txt and log-ayanova-[0-9].txt // Step 4. Define rules