Home > Forum > Plugins > Location of SDK Logs

Location of SDK Logs
3

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

In reply to: Daniel Krüger (Cosmo Consult)

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

Hey Daniel,

thank you for your log example. What do you mean with "I log the messages to the history there.".
I saw in your example that you write at the end of your code: args.LogMessage = logger.ToString();
But where can I see this log entrance? In the Webcon Designer Studio or is there another log file?

Thank you very much
Maximilian

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

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings