FTN9: FutoIn Interface - AuditLog Version: 0.1 Copyright: 2014 FutoIn Project (http://futoin.org) Authors: Andrey Galkin
It is assumed that there is a central sink for all audit log messages in the system. There should be no individual logging mechanism per component.
There should be universal Invoker and Executor API wrapper interface with handy shortcuts and formatting.
{
"iface" : "futoin.log",
"version" : "0.1",
"funcs" : {
"msg" : {
"params" : {
"lvl" : {
"type" : "string",
"desc" : "Severity level: debug|info|warn|error|security"
},
"txt" : {
"type" : "string",
"desc" : "Text message, may include new lines"
},
"ts" : {
"type" : "string",
"desc" : "Original timestamp in YYYYMMDDhhmmss.frac format"
}
},
"desc" : "Trivial log message"
},
"hexdump" : {
"params" : {
"lvl" : {
"type" : "string",
"desc" : "Severity level: debug|info|warn|error|security"
},
"txt" : {
"type" : "string",
"desc" : "Text message, may include new lines"
},
"ts" : {
"type" : "string",
"desc" : "Original timestamp in YYYYMMDDhhmmss.frac format"
},
"data" : {
"type" : "string",
"desc" : "Base64 encoded binary data"
}
},
"desc" : "Trivial log message"
}
},
"requires" : [
"SecureChannel"
],
"desc" : "Audit Log interface"
}
The raw FutoIn interface is not very handy for writing code and additional feateres are desired.
Without [RAII][] principle (e.g. Java, Python, PHP):
...log().infof( "Message %s", str )
with ...log().infos() as l:
l.write( "Message " )
l.write( str )
With [RAII][] principle (e.g. C++):
...log().infof( "Message %s", str );
...log().infos() << "Message " << str;