FTN9: FutoIn Interface - AuditLog
Version: 1.0
Date: 2015-01-21
Copyright: 2014 FutoIn Project (http://futoin.org)
Authors: Andrey Galkin

CHANGES

1. Intro

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.

2. Interface schema

    {
        "iface" : "futoin.log",
        "version" : "1.0",
        "ftn3rev" : "1.1",
        "types" : {
            "LogLevel" : {
                "type" : "string",
                "regex" : "^(debug|info|warn|error|security)$",
                "desc" : "Severity level"
            },
            "LogTimeStamp" : {
                "type" : "string",
                "regex" : "^[0-9]{14}(\\.[0-9]+)?$",
                "desc" : "Original timestamp in YYYYMMDDhhmmss.frac format"
            }
        },
        "funcs" : {
            "msg" : {
                "params" : {
                    "lvl" : {
                        "type" : "LogLevel"
                    },
                    "txt" : {
                        "type" : "string",
                        "desc" : "Text message, may include new lines"
                    },
                    "ts" : {
                        "type" : "LogTimeStamp"
                    }
                },
                "desc" : "Trivial log message"
            },
            "hexdump" : {
                "params" : {
                    "lvl" : {
                        "type" : "LogLevel"
                    },
                    "txt" : {
                        "type" : "string",
                        "desc" : "Text message, may include new lines"
                    },
                    "ts" : {
                        "type" : "LogTimeStamp"
                    },
                    "data" : {
                        "type" : "string",
                        "desc" : "Base64 encoded binary data"
                    }
                },
                "desc" : "Trivial log message"
            }
        },
        "requires" : [
            "AllowAnonymous",
            "SecureChannel"
        ],
        "desc" : "Audit Log interface"
    }

3. Extended API interface

The raw FutoIn interface is not very handy for writing code and additional feateres are desired.

3.1. Example of use

    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;

=END OF SPEC=