Forum Discussion
Lee_Sutcliffe
Jan 30, 2018Nacreous
One of the more common (and simplest) methods is to set a variable, if enabled it will log the messages to /var/log/ltm. To turn it on you just need to set the variable to 1, set to 0 to disable. Using a global static variable means you can use it in multiple iRules so you only need to enable/disable it in one place
when RULE_INIT {
set 1 to enable logging, 0 to disable
set static::debug 1
}
when HTTP_REQUEST {
some code....
if {$static::debug}{log local0. "logging is enabled"}
}