|
| 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 happens because the default logging module is based on `printf`-style |
| 31 | +format strings, which allows variable content in log messages, and it is the format string that determines message sameness. |
| 32 | + |
| 33 | +> __**_WARNING:_**__ Be cautious when enabling debug throttling, as it may cause some performance overhead due to the additional |
| 34 | +> processing required to track and suppress repeated messages. |
| 35 | +
|
| 36 | +<a name="conf.ref.debug_throttle"></a> |
| 37 | +# Configuration options |
| 38 | + |
| 39 | +Debug throttling is configured using the following options in the global scope of your `ecelerity.conf` file: |
| 40 | +- **debug_throttle_max_num_same_message** |
| 41 | +- **debug_throttle_period_secs** |
| 42 | + |
| 43 | +<a name="conf.ref.debug_throttle_max_num_same_message"></a> |
| 44 | +## Maximum number of the same message |
| 45 | + |
| 46 | +<a name="conf.ref.debug_throttle_max_num_same_message.name"></a> |
| 47 | +### Name |
| 48 | + |
| 49 | +`debug_throttle_max_num_same_message` |
| 50 | + |
| 51 | +<a name="conf.ref.debug_throttle_max_num_same_message.description"></a> |
| 52 | +### Description |
| 53 | + |
| 54 | +Sets the maximum number of repeated debug messages to log within a specified time interval. The default is `0`, which means no |
| 55 | +throttling is applied to the logging of repeated debug messages. |
| 56 | + |
| 57 | +<a name="conf.ref.debug_throttle_period_secs.example"></a> |
| 58 | +### Example |
| 59 | + |
| 60 | +``` |
| 61 | +debug_throttle_max_num_same_message = 5 |
| 62 | +``` |
| 63 | + |
| 64 | +With this configuration, only five lines of the same debug message will be logged during the time interval specified by |
| 65 | +`debug_throttle_period_secs`. |
| 66 | + |
| 67 | +<a name="conf.ref.debug_throttle_period_secs"></a> |
| 68 | +## Time interval of throttling |
| 69 | + |
| 70 | +<a name="conf.ref.debug_throttle_period_secs.name"></a> |
| 71 | +### Name |
| 72 | +`debug_throttle_period_secs` |
| 73 | + |
| 74 | +<a name="conf.ref.debug_throttle_period_secs.description"></a> |
| 75 | +### Description |
| 76 | + |
| 77 | +Sets the time interval in seconds during which repeated debug messages are counted for throttling purposes. The default is |
| 78 | +`1` second, with a maximum of `60` seconds. |
| 79 | + |
| 80 | +<a name="conf.ref.debug_throttle_period_secs.example"></a> |
| 81 | +### Example |
| 82 | +``` |
| 83 | +debug_throttle_period_secs = 30 |
| 84 | +``` |
| 85 | +With this configuration, the time interval for counting repeated debug messages is set to 30 seconds. Combined with the |
| 86 | +previous example for `debug_throttle_max_num_same_message`, only five lines of the same debug message will be logged every |
| 87 | +30 seconds. |
| 88 | + |
| 89 | +<a name="conf.ref.debug_throttle.scope"></a> |
| 90 | +# Scope |
| 91 | + |
| 92 | +Debug throttling options are valid in the global scope. |
0 commit comments