Un grand merci, ça fonctionne parfaitement. Pour les intéressés, voici le code:
local syslogServer = "192.168.6.100" -- adresse serveur Syslog
local syslogPort = 514 -- port du serveur Syslog
local hostname = "HC3-Home" -- Nom de l'émetteur
local appName = "LUA"
function QuickApp:sendSyslogMessage(message, severity, facility)
-- severity: 0= emergency, 1= alert, 2=critical, 3= error, 4= warning , 5= notice , 6= info, 7= debug,
-- facility: 1= user, 2 =mail, 3 =daemon, 4= auth, 5= syslogd, 6= lpr
local pri = (facility * 8) + severity
local timestamp = os.date("%b %d %H:%M:%S") -- Format RFC 3164 (ex. "Nov 26 15:12:43")
local syslogMessage = string.format("<%d>%s %s %s: %s", pri, timestamp, hostname, appName, message)
self.udp = net.UDPSocket({
broadcast = true,
timeout = 1000
})
self.udp:sendTo(syslogMessage, syslogServer, syslogPort, {
success = function()
print('Envoi OK')
end,
error = function(error)
print('Error:', error)
end
})
end