endurox.tplogsetreqfile

endurox.tplogsetreqfile(data: object, filename: str = '', filesvc: str = '') object

Redirect logger to request file extracted from buffer, filename or file name service. Note that in case if TPESVCFAIL error is received, exception is thrown and if data buffer was modified by the service, modification is lost. The new log file name must be present in one of the arguments. For full details see the C API call.

tplogsetreqfile example
    import endurox as e
    e.tplogsetreqfile(None, "/tmp/req_1111", None)
    # would print to "/tmp/req_1111"
    e.tplog_info("OK")
    e.tplogclosereqfile()

For more details see tplogsetreqfile(3) C API call.

Raises:

AtmiException

Following error codes may be present:
TPEINVAL - Invalid parameters.
TPENOENT - filesvc is not available.
TPETIME - filesvc timed out.
TPESVCFAIL - filesvc failed.
TPESVCERR- filesvc crashed.
TPESYSTEM - System error.
TPEOS - Operating system error.

Parameters:
  • data (dict) – UBF buffer, where to search for EX_NREQLOGFILE field. Or if field is not found this buffer is used to call filesvc. Parameter is conditional.May use None or empty string if not present.

  • filename (str) – New request file name. Parameter is conditional. May use None or empty string if not present.

  • filesvc (str) – Service name to request. Parameter is conditional. And can use None or empty string if not present.

Returns:

ret – XATMI buffer passed in as data argument and/or used for service call. If not buffer is used, NULL buffer is returned.

Return type:

dict