Home > Forum > Plugins > Location of SDK Logs

Location of SDK Logs
3

When creating an SDK action there is an option to use the Logger Class to create logs (https://developer.webcon.com/2021/resources/online-documentation-sdk/html/2c254e06-3ac3-3a82-7c44-dae3d829d1e4.htm)

Does anyone know where these logs are located (log file on file system or a specific database table)?

MVP

Hi Tim,


I once used some kind of SDK logging but the result in the history didn't looked good in BPS Portal maybe it was intended for the SharePoint version. The data was stored in xml and the xml data was displayed. But this was 2019. I'm not sure if it's the same class you referenced.

When I looked at the official signing SDK though this isn't used.
https://github.com/WEBCON-BPS/BPSExt-Signing-DocuSign/blob/5784cf2a66e946bf8a093c3f386b0b27cb0566d6/WebCon.BpsExt.Signing.DocuSign/CustomActions/SendEnvelope/SendEnvelope.cs#L15

readonly StringBuilder _logger = new StringBuilder();

If you want to use a little improved string logger you could use/build on my one.
https://github.com/cosmoconsult/webconbps/blob/c65601d8dc815feacf351e3d2ba68c3aa1d96e2c/SDK_Actions/CC_XmlToItemList/CC_XmlToItemList/IndentTextLogger.cs
I log the messages to the history there.

It just came to my mind that the class may log the messages to the plugin log. There's a specialized section in the Designer Studio.
I can add an image later, since I don't currently have access to it.

Best regards,
Daniel

WEBCON

Hi

There are three options for logging data in BPS.

The first one is properties args.Message and args.LogMessage - they are only available for CustomAction.
The data is available in the history of the workflow instance (LogMessage only in amin mode)

The second option is args.Context.Logger (AppendDebug (...) and AppendInfo (...)) - available in any kind of SDK plugin.
The data is visible in BPS Studio on the registered plugin, tab: Log . We can set there the manual log level (level Standard - logging only AppendInfo)
Additionally, we can turn on the automatic login of plugins configuration - the configuration data that the plugin has received from BPS will log in.
The data is available in BPS Studio on the grid under the login configuration.

The third option is WebCon.WorkFlow.SDK.Tools.Log.WriteToLog(...) - data is logged to EventLog: "Apllications and Services Log/WebCon WorkFlow", source: WebCon WorkFlow SDK

MVP

Thanks Tomasz for clarifying how the WriteToLog class works.

I haven't tested it, but I assume that a log entry with an exception will create an error event and one without an info.

The main use case in my opinion would be to write messages with exception if you have a tool to monitor the event logs. In this case you would be notified about any errors.

Best regards,
Daniel