|
| 1 | +--- |
| 2 | +lastUpdated: "12/31/2025" |
| 3 | +title: "Throttling Debug Messages" |
| 4 | +description: "Configure throttling to tell Momentum how to suppress repeated debug messages. When using the default logging module the messages will appear in the paniclog. The throttle is a decimal number representing the maximum number of repeated debug messages to log within a specified time interval" |
| 5 | +--- |
| 6 | + |
| 7 | +When using the default logging module, debug messages will appear in the [paniclog](/momentum/4/log-formats-paniclog) |
| 8 | +depending on subsystem and level settings configured in [Debug_Flags](/momentum/4/config/ref-debug-flags). `Debug_Flags` is |
| 9 | +usually empty, so very few events are written to the `paniclog`. However, under certain circumstances, you need to get more |
| 10 | +information about some subsystem's behavior (e.g., SMTP), then by setting `Debug_Flags`, you can enable more verbose logging |
| 11 | +into `paniclog`. On the other hand, depending on the chosen level, `paniclog` may get populated with several lines of the same |
| 12 | +message, including some that might not be of your interest. |
| 13 | + |
| 14 | +Momentum’s debug throttling configuration allows you to suppress repeated debug messages. The throttle suppresses the logging |
| 15 | +of repeated messages beyond a specified limit during a time interval also specified. It is a global setting that applies to |
| 16 | +messages of all subsystems. |
| 17 | + |
| 18 | +> **NOTE:** Debug throttling global configuration **DOES NOT** apply to messages logged at the `CRITICAL`, `ERROR`, or |
| 19 | +> `WARNING` levels of any subsystem, due to their relevance for operation and diagnosis. |
| 20 | +
|
| 21 | +It is important to note that debug throttling is applied not necessarily to *identical* messages, but to messages that are |
| 22 | +considered the same after removing variable parts such as timestamps, IP addresses, or other dynamic content. In other words, |
| 23 | +if the source of the message is something like this: |
| 24 | + |
| 25 | +``` |
| 26 | +<timestamp> Message received from: <mailfrom> |
| 27 | +``` |
| 28 | + |
| 29 | +then all messages that match this pattern will be considered the same for throttling purposes, regardless of the actual |
| 30 | +values of `<timestamp>` and `<mailfrom>`. This ensures that the throttling mechanism effectively reduces log noise while still capturing relevant information. |
| 31 | + |
| 32 | +<a name="conf.ref.debug_throttle"></a> |
| 33 | +# Configuration options |
| 34 | + |
| 35 | +Debug throttling is configured using the following options in the global scope of your `ecelerity.conf` file: |
| 36 | +- **debug_throttle_max_num_same_message** |
| 37 | +- **debug_throttle_period_secs** |
| 38 | + |
| 39 | +<a name="conf.ref.debug_throttle_max_num_same_message"></a> |
| 40 | +## Maximum number of the same message |
| 41 | + |
| 42 | +<a name="conf.ref.debug_throttle_max_num_same_message.name"></a> |
| 43 | +### Name |
| 44 | + |
| 45 | +`debug_throttle_max_num_same_message` |
| 46 | + |
| 47 | +<a name="conf.ref.debug_throttle_max_num_same_message.description"></a> |
| 48 | +### Description |
| 49 | + |
| 50 | +Sets the maximum number of repeated debug messages to log within a specified time interval. The default is `0`, which means no |
| 51 | +throttling is applied to the logging of repeated debug messages. |
| 52 | + |
| 53 | +<a name="conf.ref.debug_throttle_period_secs.example"></a> |
| 54 | +### Example |
| 55 | + |
| 56 | +``` |
| 57 | +debug_throttle_max_num_same_message = 5 |
| 58 | +``` |
| 59 | + |
| 60 | +With this configuration, only five lines debug messages will be logged during the time interval specified by |
| 61 | +`debug_throttle_period_secs`. |
| 62 | + |
| 63 | +<a name="conf.ref.debug_throttle_period_secs"></a> |
| 64 | +## Time interval of throttling |
| 65 | + |
| 66 | +<a name="conf.ref.debug_throttle_period_secs.name"></a> |
| 67 | +### Name |
| 68 | +`debug_throttle_period_secs` |
| 69 | + |
| 70 | +<a name="conf.ref.debug_throttle_period_secs.description"></a> |
| 71 | +### Description |
| 72 | + |
| 73 | +Sets the time interval in seconds during which repeated debug messages are counted for throttling purposes. The default is |
| 74 | +`1` second, with a maximum of `60` seconds. |
| 75 | + |
| 76 | +<a name="conf.ref.debug_throttle_period_secs.example"></a> |
| 77 | +### Example |
| 78 | +``` |
| 79 | +debug_throttle_period_secs = 30 |
| 80 | +``` |
| 81 | +With this configuration, the time interval for counting repeated debug messages is set to 30 seconds. Combined with the previous example, only five lines of the same debug message will be logged every 30 seconds. |
| 82 | + |
| 83 | +<a name="conf.ref.debug_throttle.scope"></a> |
| 84 | +# Scope |
| 85 | + |
| 86 | +debug_flags is valid in the global scope. |
0 commit comments