Commit 73b09d4c authored by Ted Trask's avatar Ted Trask

Modify logfile to get logging info from the config and use common view

parent 148a86c5
......@@ -19,7 +19,7 @@ function mymodule.expert(self)
end
function mymodule.logfile(self)
return self.model.get_logfile()
return self.model.get_logfile(self, self.clientdata)
end
return mymodule
<% local data, viewlibrary = ...
%>
<% if viewlibrary and viewlibrary.dispatch_component then
for i,logfile in ipairs(data.value) do
viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {filename=logfile.path, grep=logfile.grep})
end
end %>
../logfile-html.lsp
\ No newline at end of file
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment