This commit is contained in:
2022-01-21 00:46:44 +00:00
parent 95ccdd3441
commit 55a0feec64
9 changed files with 63 additions and 66 deletions

View File

@@ -12,7 +12,7 @@ Here are all the API level error codes that can be returned by the API server:
| ----- | ------------------------------ |
| 2000 | API closed - Server is running but access to the API has been closed to all users |
| 2001 | API closed all non OPS routes - Server is running but access to the API has been restricted to only server maintenance operations related functionality |
| 2002 | Internal error from the API server (HTTP STATUS 503), details in [server log](common-log.md) file |
| 2002 | Internal error from the API server (HTTP STATUS 503), details in [server log](ops-log.md) file |
| 2003 | Authentication failed (HTTP STATUS 401), bad login or password, user not found |
| 2004 | Not authorized (HTTP STATUS 403) - current user is not authorized for operation attempted on the resource (insufficient rights) |
| 2005 | Object was changed by another user since retrieval (concurrency token mismatch). A record was attempted to be saved but another user has just modified it so it's invalid. (first save "wins") |

View File

@@ -283,6 +283,6 @@ Internal server errors are returned with an HTTP Status Code of 500 and an error
}
```
For security reasons no details of an internal server exception are returned, you must examine the [server log](common-log.md) to see the details.
For security reasons no details of an internal server exception are returned, you must examine the [server log](ops-log.md) to see the details.
Generally this means the request triggered an unhandled exception which will be logged in detail to the log file.
Please report any unexpected internal server errors (preferrably with the log showing the exception details) to AyaNova support so we can look into it.

View File

@@ -1,55 +0,0 @@
# LOGGING
#b4beta (why is this here, isn't this ops info? links? sb client end log instead if not in ops?)
AyaNova keeps a log of important events for troubleshooting purposes.
AyaNova logs to the file log-ayanova.txt.
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.
## Log path
By default AyaNova logs to a `logs` folder in the location specified by [AYANOVA_DATA_PATH](ops-config-data-path.md) setting.
You can override this and set a custom log location by command line argument or by setting the "AYANOVA_LOG_PATH" environment variable.
Example command line log path parameter
`"dotnet run --AYANOVA_LOG_PATH=/home/gztw/Documents/temp/cmdlinelogs"`
## Log level
AyaNova supports 6 levels of logging, the default level is "Info" which is a medium level and will log general operations and any errors or warnings that may arise.
**WARNING**
AyaNova server performance will be impacted negatively when setting a log level lower than Info. A very large amount of information is logged at Debug or lower levels and each item logged takes time away from the normal server operations. Unless directed to by technical support or attempting to diagnose a specific problem, you should avoid setting a log level lower than "Info".
You can set the log level via environment variable or command line parameter "AYANOVA_LOG_LEVEL".
For example from the command line
`"dotnet run --AYANOVA_LOG_LEVEL=Info"`
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.
## Troubleshooting logging
If you are having issues with logging you can enable a logger diagnostic log with a command line parameter or environment variable.
Enabling this setting will cause a log file named "log-ayanova-logger.txt" to be written to the folder AyaNova is started in.
Command line parameter
`-- AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG=true`
or set the environment variable
`AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG = true`
Warning: this diagnostic log should be disabled as soon as it's not required. Unlike the normal log, this log file is not automatically trimmed so it will grow in size forever and will slow down the server.

View File

@@ -68,9 +68,9 @@ Command line parameters are appended to the command to start the ayanova server,
### LOGGING
- [AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG](common-log.md#troubleshooting-logging)
- [AYANOVA_LOG_LEVEL](common-log.md#log-level)
- [AYANOVA_LOG_PATH](common-log.md#log-path)
- [AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG](ops-log.md#troubleshooting-logging)
- [AYANOVA_LOG_LEVEL](ops-log.md#log-level)
- [AYANOVA_LOG_PATH](ops-log.md#log-path)
### TRANSLATION

View File

@@ -7,7 +7,7 @@ Server error codes are different from [API error codes](api-error-codes.md) whic
The purpose of these server error codes is to make it easier to look them up in this manual and easily communicate errors to technical support if necessary.
In most cases where an error occurs there will be more detailed information about the error in the [log file](common-log.md).
In most cases where an error occurs there will be more detailed information about the error in the [log file](ops-log.md).
Here are all the error codes that can be returned by the AyaNova server:

View File

@@ -1,6 +1,58 @@
# OPS-LOG Placeholder
# Server log
[UNDER CONSTRUCTION]
AyaNova keeps a log of important events for troubleshooting purposes.
AyaNova logs to the file log-ayanova.txt.
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.
## Log path
By default AyaNova logs to a `logs` folder in the location specified by [AYANOVA_DATA_PATH](ops-config-data-path.md) setting.
You can override this and set a custom log location by command line argument or by setting the "AYANOVA_LOG_PATH" environment variable.
Example command line log path parameter
`"dotnet run --AYANOVA_LOG_PATH=/home/gztw/Documents/temp/cmdlinelogs"`
## Log level
AyaNova supports 6 levels of logging, the default level is "Info" which is a medium level and will log general operations and any errors or warnings that may arise.
**WARNING**
AyaNova server performance will be impacted negatively when setting a log level lower than Info. A very large amount of information is logged at Debug or lower levels and each item logged takes time away from the normal server operations. Unless directed to by technical support or attempting to diagnose a specific problem, you should avoid setting a log level lower than "Info".
You can set the log level via environment variable or command line parameter "AYANOVA_LOG_LEVEL".
For example from the command line
`"dotnet run --AYANOVA_LOG_LEVEL=Info"`
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.
## Troubleshooting logging
If you are having issues with logging you can enable a logger diagnostic log with a command line parameter or environment variable.
Enabling this setting will cause a log file named "log-ayanova-logger.txt" to be written to the folder AyaNova is started in.
Command line parameter
`-- AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG=true`
or set the environment variable
`AYANOVA_LOG_ENABLE_LOGGER_DIAGNOSTIC_LOG = true`
Warning: this diagnostic log should be disabled as soon as it's not required. Unlike the normal log, this log file is not automatically trimmed so it will grow in size forever and will slow down the server.
Log items that might appear and what they mean:

View File

@@ -10,7 +10,7 @@ When AyaNova creates it's database for the first time, PostgreSQL server will se
For more information see the PostgreSQL [Localization documentation](https://www.postgresql.org/docs/current/locale.html)
## AyaNova locale setting information
The current locale settings can be viewed in the AyaNova user interface under Server Operations -> Server Information page in the "DB server parameters" section, specifically the `lc_collate` and `lc_ctype` runtime parameters. This information is also logged to the AyaNova server log if the server's [AYANOVA_LOG_LEVEL](common-log.md#log-level) is set to DEBUG mode or lower.
The current locale settings can be viewed in the AyaNova user interface under Server Operations -> Server Information page in the "DB server parameters" section, specifically the `lc_collate` and `lc_ctype` runtime parameters. This information is also logged to the AyaNova server log if the server's [AYANOVA_LOG_LEVEL](ops-log.md#log-level) is set to DEBUG mode or lower.
## Sorting

View File

@@ -147,7 +147,7 @@ nav:
- 'Backup': 'ops-form-backup.md'
- Technical:
- 'Maintenance': 'ops-maintenance.md'
- 'Logging': 'common-log.md'
- 'Logging': 'ops-log.md'
- 'View server settings': 'ops-server-information.md'
- 'Server locale settings': 'ops-server-locale.md'
- 'Translation / Language': 'ops-config-default-translation.md'

View File

@@ -37,7 +37,7 @@ namespace AyaNova.Biz
| 2000 | API closed - Server is running but access to the API has been closed to all users |
| 2001 | API closed all non OPS routes - Server is running but access to the API has been restricted to only server maintenance operations related functionality |
| 2002 | Internal error from the API server, details in [server log](common-log.md) file |
| 2002 | Internal error from the API server, details in [server log](ops-log.md) file |
| 2003 | Authentication failed, bad login or password, user not found |
| 2004 | Not authorized - current user is not authorized for operation attempted on the resource (insufficient rights) |
| 2005 | Object was changed by another user since retrieval (concurrency token mismatch). A record was attempted to be saved but another user has just modified it so it's invalid. (first save "wins") |