Using a Custom Logging Function with wolfSSL



If you are working on integrating wolfSSL into an application that already has existing logging functionality, but still want access wolfSSL's built-in debug messaging, you can register a custom logging callback with wolfSSL to output wolfSSL's detailed debug messaging.

To enable this functionality, add the configure option “--enable-debug” to wolfSSL. Then, in your application simply:
• Include
• Call wolfSSL_Debugging_ON();
• Call wolfSSL_SetLoggingCb(&custom_logging_cb);

The custom logging function provided to wolfSSL_SetLoggingCb should be of type:

void wolfSSL_Logging_cb(const int logLevel, const char *const logMessage);

Adding this logging support will enable wolfSSL debug messaging with general information (including which function is currently executing), notes about function execution and code path, as well as additional information on any errors occurring during execution. It's a great tool to help track down any bugs you run into when integrating wolfSSL. For more information please see the debugging section in the wolfSSL embedded SSL/TLS manual: https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-8-debugging.html

Originally posted at: http://www.wolfssl.com/wolfSSL/Blog/Entries/2015/8/14_Using_a_Custom_Logging_Function_with_wolfSSL.html
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.