diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-10-05 14:31:02 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-10-05 14:31:02 +0000 |
commit | 73b09d4c9c5c2c4c562e4164da76b0f214ebf618 (patch) | |
tree | b8dfcda23b15e3a2ef92d085fee20cdf5aa1828d /dovecot-model.lua | |
parent | 148a86c51bfb642978e33ad0e1920685ba27e151 (diff) | |
download | acf-dovecot-73b09d4c9c5c2c4c562e4164da76b0f214ebf618.tar.bz2 acf-dovecot-73b09d4c9c5c2c4c562e4164da76b0f214ebf618.tar.xz |
Modify logfile to get logging info from the config and use common view
Diffstat (limited to 'dovecot-model.lua')
-rw-r--r-- | dovecot-model.lua | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/dovecot-model.lua b/dovecot-model.lua index 74aff69..e2cd0f0 100644 --- a/dovecot-model.lua +++ b/dovecot-model.lua @@ -46,18 +46,22 @@ function mymodule.get_logfile(f) config = config or format.parse_ini_file(fs.read_file(configfile) or "", "") local files = {} if config and config.log_path then - files[#files+1] = {path = config.log_path} + files[#files+1] = {filename = config.log_path} end if config and config.info_log_path then - files[#files+1] = {path = config.info_log_path} + files[#files+1] = {filename = config.info_log_path} end - if config and config.log_path then - files[#files+1] = {path = config.debug_log_path} + if config and config.debug_log_path then + files[#files+1] = {filename = config.debug_log_path} end if 0 == #files then - files[#files+1] = {path = "/var/log/messages", grep = "dovecot"} + if config and config.syslog_facility then + files[#files+1] = {facility = config.syslog_facility, grep = "dovecot"} + else + files[#files+1] = {facility = "mail", grep = "dovecot"} + end end - return cfe({ value=files, label="DoveCot Log Files" }) + return cfe({ type="structure", value=files, label="DoveCot Log Files" }) end return mymodule |