lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I was trying to deal with some issues with my kernel logger and
realized that if a logger were designed with Lua in mind, it oughtta
be pretty easy to configure it exactly the way I wanted it.
The overall architecture as I see it is this:
- Logger starts
-- Lua configuration loaded which defines a list of handlers/filters
-- Kernel writes messages to the interface
--- interface pipes data through lua functions collected from the
configuration

The lua functions could in turn do 'virtually' anything, filter by
regex/loglevel/resource (whatever the system gives).  The functions
could write out to a log file w/ various buffering options to
prevent too much disk activity.  Sockets could be written to,
perhaps w/ a keepalive option (so sockets wouldn't have to stay open
for the entire system period, only when there's a certain amt of
activity through the filter).  Databases could be written to through
LuaSQL.  Options are virtually endless... and truely endless if I
permit the loading of external libraries.

Now... there is a security risk... but ONLY if you let unauthorized
persons to touch the log configurations/etc... but that's the case
with any logging system AFAIK.

Any ideas?  Also, I haven't dealt with logging before, but it seems
that there's not enough messages being piped through the logs for
Lua to be a bottleneck (though I may have to set it up so that
socket ops/etc are asynchronous or posted to a worker instance, ex:
through LuaTasks.

Once I find some free time (busy college student), I'll look at code
from other loggers and try to setup a basic framework to try it out.
 I also plan on posting this in LuaForge (unless any of you have any
better ideas, or perhaps a server that uses SVN [my vs of choice])
-- 
Thomas Harning Jr.

Attachment: signature.asc
Description: OpenPGP digital signature