Application logs are an important asset for diagnosing and fixing software issues. When unexpected behavior or errors occur, logs provide valuable information about the state of the system, the sequence of events leading up to the issue, and the values of variables or inputs at critical points. Developers can analyze the logs to identify the root cause of problems and create the necessary fixes.
How to collect logs?
There are multiple methods available for log collection:
- Through the Desktop Client: This method offers convenience and can be executed by any user. However, please note that there is a possibility of missing events, particularly when DEBUG or VERBOSE logging options are chosen, and the logs have already been rotated before collection. If the support team requests the collection of DEBUG or VERBOSE logs, we recommend increasing the log size to a minimum of 100 MB and the maximum volume to at least 2,500 MB. For detailed instructions, please refer to the in-client manual available here.
- Log directories on the system: If you only have access to the server application, it can be helpful to collect the logs directly from the server. Please follow the instructions provided in the support article accessible here for guidance on how to collect logs from the log directories.
- Real-time log following: In situations where there is a continuous stream of log entries and logs are rotated rapidly, real-time following of logs becomes an effective method to gather the relevant information. You can find instructions on how to perform real-time log following in the support article provided here.
These methods provide different options for log collection depending on your specific needs.
Log levels
Log levels are used in software development to categorize and prioritize log messages based on their severity or importance. Each log level represents a different level of detail or verbosity in the logged information. Here's an explanation of each log level:
- NONE: This log level indicates that no logs should be recorded. It essentially disables logging altogether. It is useful in production environments where logging is not required or might have a significant performance impact.
- ERROR: This log level is used to indicate critical errors or exceptional conditions that prevent the software from functioning properly. Error messages typically represent issues that require immediate attention, as they indicate a failure or malfunction in the system.
- WARNING: The warning log level is used to highlight potential issues or situations that could lead to errors or unexpected behavior in the software. Warnings indicate non-fatal problems that might not immediately affect the system's functionality but should still be addressed to prevent future errors.
- INFO: The info log level provides general information about the application's execution. It is used to log significant events or milestones that help track the running status and progress of an application. Info messages are typically used to give an overview of the system's state or provide relevant contextual information.
- DEBUG: The debug log level is used for detailed information primarily intended for debugging purposes during development or troubleshooting. Debug messages provide extensive details about the application execution flow, variable values, and intermediate steps. These messages are useful for diagnosing issues, tracing program behavior, and analyzing the software's internal workings.
- VERBOSE: The verbose log level represents the highest level of detail or verbosity in logging. It includes all log messages, including debugging statements, and often provides excessive information that might not be relevant in most scenarios. The verbose level is typically used when maximum detailed information is required, but it is not commonly used in production environments.
The purpose of log levels is to control the amount and type of information logged based on the software's execution context. This flexibility allows developers and system administrators to configure the logging system to capture the appropriate level of detail required for monitoring, debugging, and troubleshooting purposes. At each log level, all the information from the lower log levels is included. This means that higher log levels encompass the details provided by the lower log levels as well.
The default log level for the Desktop Client is NONE, and for the Server Application it is INFO.
Some important notes
- When the system's default load is already quite high, it is advisable to reduce the system load before raising the log level. For instance, you can consider relocating some cameras to another server within the system or temporarily disabling specific rules, such as analytics. These steps can help alleviate the system load.
- If you decide to elevate the log level, it is highly recommended to have administrator rights at the operating system level. This way, if the increased loglevel causes the application to become unresponsive, you have the capability to lower the log level again through the application configuration file. Having this control ensures you can manage any potential issues that may arise.
- In situations where issues arise, and you need to provide additional information, such as logs, it is essential to ensure that the timespan of the logs aligns with the timeframe during which the issue occurred. This guarantees that the relevant events associated with the problem are captured in the logs.
- We advise against raising the log level to a higher level than the default settings unless there is a specific purpose for doing so. Increasing the log level unnecessarily might result in additional system load and an increased number of I/O requests to the storage drives.
- Note that if you encounter any issues and need to include logs for troubleshooting purposes, we kindly request that you refrain from elevating the log level to VERBOSE unless specifically instructed to do so by our support team. Enabling VERBOSE logging generates a large amount of information, which can prolong the investigation process and also increases the likelihood that the logs may have already been rotated, making it difficult to identify the root cause of the issue.
- Finally, please be aware that enabling VERBOSE logging may require a significant amount of storage, potentially several gigabytes. It is important to adjust the number of log files and the log file system accordingly to accommodate this increased volume of log data. To ensure smooth processing, it is recommended to set the maximum log file size to 500 MB.
Comments
0 comments
Please sign in to leave a comment.