On 12-Oct-2010 13:51, Ben Franksen wrote:
On Dienstag, 12. Oktober 2010, Andrew Johnson wrote:
On Friday 08 October 2010 21:10:26 [email protected] wrote:
I was wondering where the writes to the put log are done in the
gateway source code? I would like to try to modify the source to
allow multiple gateways to write this information to a central
database, but I'm having a bit of a hard time finding the calls in
the code.
I believe this is done through an Access Security hook, so the
gateway calls an asLib routine to check rights and that calls back
into the hook routine. If you look at the documentation for asLib in
the Application Developers' Guide you should find something about
that, but if not ask again and I'll go hunting.
Right, at least that is how it is done on the IOC. You can even
configure put logging in the access security configuration file; IIRC
the gateway has such a file, too.
Note that --again, this is how it works on the IOC-- neither access
security, nor any other part of the IOC knows anything about caPutLog.
Instead, the initialization routine of the caPutLog facility registers
a callback with access security (calling asTrapWriteRegisterListener),
which in turn does the actual logging via calls to logClientSend (see
src/libCom/logClient in base).
Correct.
As the Gateway uses the same access security library as the IOC, to use
caPutLog you would have to link the Gateway against the caPutLog code
compiled for your architecture, and probably call caPutLog's
initialization routine manually somewhere from within main() or one of
the main classes to make sure caPutLog registers with access security
early enough.
Once you have it working, please send a patch and/or a description, as
others might want to do the same and could benefit from your work.
That's probably at least worth a readme or a page on the wiki.
Good luck!
Ralph