Skip to main content
Skip table of contents

Logging

SYSADMIN.logMsg

This procedure logs a message to the underlying logging system.

SQL
SYSADMIN.logMsg(OUT logged boolean NOT NULL RESULT, IN level string NOT NULL DEFAULT 'DEBUG', IN context string NOT NULL DEFAULT 'org.teiid.PROCESSOR', IN msg object NOT NULL)

If the message has been logged, it returns TRUE. The level can be one of the Log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. The level defaults to DEBUG and the context defaults to org.teiid.PROCESSOR.

Example

SQL
CALL SYSADMIN.logMsg(msg => 'some debug', context => 'org.something')

This will log the message 'some debug' at the default level DEBUG to the context org.something.

SYSADMIN.isLoggable

This procedure checks if logging is enabled at the given level and context.

SQL
SYSADMIN.isLoggable(OUT loggable boolean NOT NULL RESULT, IN level string NOT NULL DEFAULT 'DEBUG', IN context string NOT NULL DEFAULT 'org.teiid.PROCESSOR')

If logging is enabled, it returns TRUE. The level can be one of the Log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. The level defaults to DEBUG and the context defaults to org.teiid.PROCESSOR.

Example

SQL
BEGIN
    IF ((SELECT loggable FROM SYSADMIN.isLoggable(context => 'org.something')))
    BEGIN
        CALL SYSADMIN.logMsg(msg => 'This message is going to be logged', context => 'org.something');
    END
END
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.