About trace messages
- Last UpdatedApr 10, 2025
- 3 minute read
There are several trace messages within the AVEVA™ Production Management code for diagnostics. This information can be helpful when you diagnose runtime issues. AVEVA™ Production Management writes trace messages to the Server Diagnostics pane in Studio, as well as the Windows Application Event Log.
Note: By default, a new project only writes Information messages.

Trace Level property
Within Studio, a TraceLevel property is available on almost every item. Trace messages are custom debug statements that “trace” the execution of code. Trace messages are assigned a unique level to facilitate filtering. For example, during testing you might want to see every trace message for a section of code; however, after testing, you may want to see only items that have are errors or warnings.
Levels for Trace messages
There are four levels for trace messages:
-
Error
-
Warning
-
Info
-
Verbose
The Server Diagnostics pane provides filtering of the messages based on the trace level. This filter determines what messages appear in the Diagnostics window. You cannot set the filter retrospectively. The filter is used during runtime to determine which messages to generate. It is usually a good idea to set the level Verbose. The Verbose filter does not affect what trace messages are written to the Windows Application Event Log.
For more information, see Understand message severity levels.
Setting the TraceLevel for an Item
There are two types of objects that can generate trace messages within AVEVA™ Production Management: a project and an item. Both of these objects have a TraceLevel property.

Each item within AVEVA™ Production Management behaves differently, and therefore the trace messages that can be enabled are different for each item. For example, you may want to debug an accumulator field or capture condition that has an expression linked to a ScadaVariable. If you set the TraceLevel on the ScadaVariable to Verbose, you are provided with detailed trace messages regarding the runtime operation of that particular ScadaVariable.
Use care when you change the TraceLevel of items, as the Server performance can be impacted if a lot of trace messages are written continually. TraceLevel messages are most useful when used in a commissioning environment to debug projects.
Setting the TraceLevel for a Project
Navigate to the root-node of a project within Studio to set the TraceLevel for a project. The root-node is the computer name of Server. The root-node has a TraceLevel property that can be set. This does not affect the TraceLevel properties for individual items within the project.
Note: The TraceLevel property is not recursive. Each item is set individually.
The Project TraceLevel reports messages that relate to the internal runtime operators of Server. Typically, it is sufficient to leave the TraceLevel of the project with the value of Error. However you are required to change the Project TraceLevel for Code items. This is because Code items are run internally by Server. If you have a project that uses Code items, it is good practice to comment your Code item, as well as to provide trace messages for debugging.
Include the following namespaces to output trace messages from a Code item.
using System.Diagnostics;
using Citect.Ampla.Framework;
The following example shows a simple class that demonstrates how to write a trace message.

