[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mod-security-users
Subject:    [mod-security-users] Logging Lua rule activity other than using m.log()
From:       J Doe <general () nativemethods ! com>
Date:       2017-05-18 22:19:20
Message-ID: 74AE4549-CDE2-4B9F-AFE4-2B85A3539310 () nativemethods ! com
[Download RAW message or body]

Hi,

I was wondering if there was a way to output data to a log file in Lua other than \
using m.log() ?

My plan was to use the io library provided with Lua's Standard Library.  I am hoping \
to use this as opposed to m.log() as I'd like to log a bunch of data that probably \
would be harder to read as a single line stored in the error or debug log.

Of course, the concern is what happens when different processes/threads are handling \
the same Lua rule at the same time.  I was naively wondering if I can open the log \
file in append mode, but that probably won't work if two Apache processes running the \
same Lua rule race to grab access to the log file at the same time, will it ?

I am guessing there is no way to lock access to a file from Lua as that would be an \
OS level thing and the os library is rather limited.  Does anyone know if anyone has \
created bindings or a LuaRock with this functionality available ?

Is m.log() the only synchronized facility for writing to a log file ?

Thanks,

- J

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mod-security-users mailing list
mod-security-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-security-users
Commercial ModSecurity Rules and Support from Trustwave's SpiderLabs:
http://www.modsecurity.org/projects/commercial/rules/
http://www.modsecurity.org/projects/commercial/support/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic