Skip to main content

Name

ec_log_file — log to a file/io wrapper

Synopsis

ec_log_file { file uri } { arbitrary_text }

Description

ec_log_file allows you to log arbitrary information to a specified file or io wrapper. Unlike the ec_log action the raw message, plus an appended newline, will be written to the file, with no additional context or timestamp information unless present in the user-defined message. The message will be written regardless of the Debug_Flags setting.

if envelope :domain :is "from" "good-guy.com" {
  ec_log_file "/var/log/logfile" "got mail from the good guys";
}

if envelope :domain :is "from" "good-guy.com" {
  ec_log_file "jlog:///var/log/ecelerity/queue.rt=>master" "got mail from the good guys";
}

Be sure that you have permission to write to the directory containing the output file.

Since the Sieve validation phases through the data phase are executed in the scheduler thread, no I/O should be done during these phases. Use this function after the data phase.

See Also

Was this page helpful?