Updating the Logging Level for VERA Server
The messages log for VERA Server can be configured to various logging levels in order to filter messages based on urgency. To set the logging level, the following steps must be taken:
Create/Edit the system environment variable for VERA_SERVER_LOG_LEVEL
The variable value can be set to any of the levels in the table below.
By default, the logging level will be set to INFO. This means that if the environment variable is not configured at all or contains a value not supported by VERA as shown in the table below, the INFO logging level will be used.
Level | Description |
---|---|
INFO | An informational listing of messages between the VERA API and external consumers. |
FULL | A verbose listing of all internal and external messages along with their payloads for VERA Server. |
NONE | Disables all logging for VERA server messages |
Additional Logging and Controls
VERA Server provides troubleshooting information through several log files and logging levels within those files.
Log Name | Log File | Description | Log Level | Included Information |
---|---|---|---|---|
Info | vera-server-info | Logs provided by ASP.Net Core | Information | All logging provided by ASP.Net Core |
Errors | vera-server-errors | Errors and Exceptions encountered during processing | Error | Errors and Exceptions |
Database | vera-server-database | MongoDB database interactions | Error | Connection Failed Command Failed |
Information | Connection Created Connection Opened Connection Closed | |||
Debug | Connection Opening Connection Closing Command Started Command Succeeded | |||
Messages | vera-server-messages | Primary External and Internal Messaging | Information | Messaging according to the VERA_SERVER_LOG_LEVEL environment variable as described above. |
Messages qTest | vera-server-messages-qtest | Messaging between VERA and the qTest API | Information | Request and response at qTest API endpoints |
Debug | Payloads with the qTest API messages | |||
Messages Jira | vera-server-messages-jira | Messaging between VERA and the Jira API | Information | Request and response at Jira API endpoints |
Debug | Payloads with the qTest API messages |
Log Levels
The supported log levels from least information to most is:
Fatal
Error
Warning
Information
Debug
Verbose
Each lower level includes everything from the levels above it.
By default, all levels are set to Information.
Log Locations and File Processes
By default, logs are written to the Logs folder off of the path specified in the VERA_SERVER_DATA_DIR environment variable.
Files roll by a combination of date and size.
By default, log files are rolled by day with a size limit of 1Gb and the latest 31 log files kept in raw form. Older log files are compressed using GZIP compression.
Filenames follow this structure:
BaseLogFile-YYYYmmDD( xxx).txt(.gz)
For example: vera-server-messages-20220824 001.gz
Configuring Logging to the File System
Logging settings can be modified via a "logging-settings.json" file in the Configs folders off of the path specified in the VERA_SERVER_DATA_DIR environment variable.
This is a JSON file with settings for each Log file. Configuration of a particular log can be done by adding an appropriate section to the file. Configuration that matches the defaults is as follows using the Messages log as the example:
"Messages": {
"MinimumLevel": "Information",
"WriteTo": [
{ "Name": "File",
"Args": {
"path": "%VERA_SERVER_DATA_DIR%/Logs/vera-server-messages-.txt",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message}{NewLine}",
"rollingInterval": "Day",
"rollOnFileSizeLimit": true,
"hooks": "Vera.Logging.SerilogHooks::ArchiveHooks, Vera.Logging"
}
}
]
}
The most important configuration point is the “MinimumLevel” which is where the level is set for that log.
Other options can be configured to control the retention and size of logs. For more information on levels, see https://tx3.atlassian.net/wiki/spaces/V20233/pages/437000680
The following is a list of all modules that support independent logging (for more information on what is being logged, see Retrieving Log Files):
Module Name | Default Log File Name | Recommended Minimum Level |
---|---|---|
API qTest RouteActions | vera-server-api-qtest-routeactions-.txt | Information |
API Routes RouteEvents | vera-server-api-routes-routeevents-.txt | Information |
Connections | vera-server-connections-.txt | Information |
Database | vera-server-database-.txt | Information |
Errors | vera-server-error-.txt | Information |
Info | vera-server-info-.txt | Information |
Messages | vera-server-messages-.txt | Information |
Messages Jira | vera-server-messages-jira-.txt | Information |
Messages qTest | vera-server-messages-qtest-.txt | Information |
Messages Tosca | vera-server-messages-tosca-.txt | Information |
Migration | vera-server-migration-.txt | Information |
Verification | vera-server-verification-.txt | Information |
Webhooks | vera-server-webhooks-.txt | Information |
Worker qTest | vera-server-worker-qtest-.txt | Information |