OTX-Runtime for DotNet
|
|
With logging and tracing, selected software actions are written to a file with the aim to log the executed actions for later investigations.
Within the OTX tool chain, there are the following independent logging sources. A distinction is made between OTX logging and tool tracing. OTX logging refers to log within OTX with the OTX Logging extension and tool tracing refers to logging within OTX tools such as OTX-Runtime API or OTX-DiagManager API. Furthermore there is a complete tracing of the diagnostic communication.
Other Topics:
If the folder for the logging and tracing was not changed the table lists the default log folders.
Logging Type | Windows | Linux |
---|---|---|
OTX Logging with OTF | "<USER>/AppData/Roaming/OpenTestSystem/<ShortVersion>/Open Test Framework/OTX-Logging" | - |
OTX Logging with OTX-Runtime API | "<USER>/AppData/Roaming/OpenTestSystem/<ShortVersion>/OTX-Runtime API/OTX-Logging" | "<TempDir>/OpenTestSystem/<ShortVersion>/OTX-Runtime-API/OTX-Logging" |
Tool Tracing | "<USER>/AppData/Roaming/OpenTestSystem/<ShortVersion>/OTX-Runtime API/Logging" | "<TempDir>/OpenTestSystem/<ShortVersion>/OTX-Runtime-API/Logging" |
DiagManager Tracing | "<USER>/AppData/Roaming/OpenTestSystem/<ShortVersion>/DiagManager/Logging" | "<TempDir>/OpenTestSystem/<ShortVersion>/DiagManager/Logging" |
DiagLogging | "<USER>/AppData/Roaming/OpenTestSystem/<ShortVersion>/DiagManager/Logging" | "<TempDir>/OpenTestSystem/<ShortVersion>/DiagManager/Logging" |
The OTX Logging extension provides functionality which allows for writing log-messages to a logging-resource inside OTX test logic, see WriteLog. This logging is part of the OTX test logic. Two pieces of information are required for logging. The message and the severity level of the log message. The severity can be used to filter which log messages are actually written to the log file.
Note: Log messages are only written to the log file if their SeverityLevel is greater than or equal to the LogLevel.
Note: The settings for the OTX logging are made in the Project settings in the PTX and can be overwritten via the Project settings on the API, see List of all Project Settings.
Note: The logging implementation delivered with the OTX-Runtime API can be replaced by an own implementation, see Custom Implementations.
Note: Each execution creates a new log file.
The implementation of the OTX Logging extension in the OTX-Runtime API supports two types of logging:
Explicit OTX logging is logging via the WriteLog action of OTX. An OTX author can explicitly write a message to the log file anywhere within the OTX test logic via WriteLog.
With implicit OTX logging, the OTX-Runtime API automatically generates log messages during OTX execution, see table. The settings for the implicit OTX logging are made in the Project settings in the PTX and can be overwritten via the Project settings on the API. A SeverityLevel can be set for each implicit log message.
Implicit OTX Logging | Description | Switch ON/OFF (Setting) | Severity (Setting) |
---|---|---|---|
Communication Trace | Writes the request and response PDUs of diagnostic communication into the log file. | LogCommunicationTrace | LogCommunicationTraceSeverityLevel |
Variables Trace | Writes each change of each OTX declaration into the log file. | LogVariableTrace | LogVariableTraceSeverityLevel |
OTX Exceptions | Writes each OTX exception into the log file. | LogOtxException | LogOtxExceptionSeverityLevel |
OTX IDs | Writes the OtxId of each executed activity into the log file. | WriteId | WriteIdSeverityLevel |
With the implicit OTX ID logging the following profiling information will be written into the log file:
Note: The profiling can be analysed with the OTX Profiler inside the OTX Development Environment.
The tool tracing can write each activity of the OTX-Runtime API and the OTX-DiagManager API into a log file.
The settings for OTX-Runtime API tracing are made in the RuntimeConfig class, see TraceFolder for the storage directory and OpenTestSystem. Otx.Runtime.Api.RuntimeConfig.TraceLevel "TraceLevel" for message filtering.
Note: A TraceLevel greater Info can have a significant impact on performance and should not be used productively.
Note: For technical reasons, several log files are generated in the same folder depending on the API used, see table below.
Note: Each execution creates a new set of log files.
Log File | Description | Filename format | Settings |
---|---|---|---|
OTX Runtime API CPP | Writes messages of the CPP OTX Runtime API into the log file. | OtxRuntimeApiTrace_CPP_YYYYMMDD_hhmmss.log | RuntimeConfig |
OTX Runtime API DotNet | Writes messages of the DotNet OTX Runtime API into the log file. | OtxRuntimeApiTrace_Dotnet_YYYYMMDD_hhmmss.log | RuntimeConfig |
OTX Runtime API Java | Writes messages of the Java OTX Runtime API into the log file. | OtxRuntimeApiTrace_Java_YYYYMMDD_hhmmss.log | RuntimeConfig |
OTX Runtime Runner | Writes messages of the OTX Runtime runner into the log file. | OtxRunnerTrace_CPP_YYYYMMDD_hhmmss.log | RuntimeConfig |
The settings for OTX-DiagManager API tracing are made in the LoggerConfig class, see SetupTracer.
Note: For technical reasons, several log files are generated in the same folder depending on the API used, see table below.
Log File | Description | Filename format | Settings |
---|---|---|---|
DiagManager API CPP | Writes messages of the CPP DiagManager API into the log file. | DiagManagerApi_CPP_YYYY-MM-DD.log | LoggerConfig |
DiagManager API DotNet | Writes messages of the DotNet DiagManager API into the log file. | DiagManagerApi_Dotnet_YYYY-MM-DD.log | LoggerConfig |
DiagManager API Java | Writes messages of the Java DiagManager API into the log file. | DiagManagerApi_Java_YYYY-MM-DD.log | LoggerConfig |
DiagManager Runner | Writes messages of the DiagManager runner into the log file. | OpenTestSystem.OtxDiagManager.Runner_YYYY-MM-DD.log | LoggerConfig |
The DiagLogging is part of the OTX-DiagManager API and can create a log file with the complete diagnostic communication which was executed via OTX-DiagManager API. It can contain PDUs, ODX structures and communication parameters, sample see below. The logging must be started via StartDiagLoggging and can be stopped via StopDiagLogging.
Note: Each execution creates a new log file.
Log File | Description | Filename format | Settings |
---|---|---|---|
DiagManager DiagLogging | Writes diagnostic communication into the log file. | "DiagLogging_DiagManager Monitor_YYYYMMDDhhmmss.log" | StartDiagLoggging |
Sample log file for DiagLogging:
If the OTX runtime is integrated into an application, it can be difficult to change the logging settings without making changes in the application. To avoid this, it is possible to overwrite all logging settings using a configuration file as follows:
OtxRuntimeSettings.ini
, see Configuration File to the folder where the OTX runtime is locatedNote: All listed properties inside
OtxRuntimeSettings.ini
can no longer be changed using the API. This means that the API call has no effect on this property.
Note: Properties that are not present in the
OtxRuntimeSettings.ini
can be set by the application.
Note: The values of the enumerations are the string representation of the related value.
Note: The values of the enumerations and
TRUE
andFALSE
are not case sensitive.
Note: If the DiagManager is in its own folder (different to OTX-Runtime), it uses the
OtxRuntimeSettings.ini
inside this folder.
The example file lists all settings. The settings are self-explanatory based on their names. The possible values of a setting are derived from their respective settings in the OTX runtime.