#### 3.10.1.3 Logging and debugging ¶

The default behavior of `sieve` is to remain silent about anything except errors. However, it is sometimes necessary to see which actions are executed and on which messages. This is particularly useful when debugging the sieve scripts. The `--verbose` (`-v`) option outputs log of every action executed.

Option `--debug` allows to produce even more detailed debugging information. This option takes an argument specifying the debugging level to be enabled. The argument can consist of the following letters:

‘`t`’

  This flag enables sieve tracing. It means that every test will be logged when executed.

‘`T`’

  This flag enables debugging of underlying `mailutils` library.

‘`P`’

  Trace network protocols: produces log of network transactions executed while running the script.

‘`g`’

  Enable main parser traces. This is useful for debugging the sieve grammar.

‘`i`’

  Trace the program instructions. It is the most extensive debugging level. It produces the full execution log of a sieve program, showing each instruction and states of the sieve machine. It is only useful for debugging the code generator.

Note, that there should be no whitespace between the short variant of the option (`-d`), and its argument. Similarly, when using long option (`--debug`), its argument must be preceded by equal sign.

If the argument to `--debug` is omitted, it defaults to ‘`TPt`’.

Option `--dump` produces the disassembled dump of the compiled sieve program.

By default `sieve` outputs all diagnostics on standard error and verbose logs on standard output. This behaviour is changed when `--log-facility` is given in the command line (see logging). This option causes `sieve` to output its diagnostics to the given syslog facility.