/usr/share/lua/5.1/logging/socket.lua is in lua-logging 1.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | -------------------------------------------------------------------------------
-- Sends the logging information through a socket using luasocket
--
-- @author Thiago Costa Ponte (thiago@ideais.com.br)
--
-- @copyright 2004-2013 Kepler Project
--
-------------------------------------------------------------------------------
local logging = require"logging"
local socket = require"socket"
function logging.socket(address, port, logPattern)
return logging.new( function(self, level, message)
local s = logging.prepareLogMsg(logPattern, os.date(), level, message)
local socket, err = socket.connect(address, port)
if not socket then
return nil, err
end
local cond, err = socket:send(s)
if not cond then
return nil, err
end
socket:close()
return true
end)
end
return logging.socket
|