Conditional 'Log Message'

Create a new (or update existing ‘Log Message’) activity alike ‘Check True’ activity.
The message is logged only in case the Condition argument will evaluate as TRUE.
Default value of Condition would be TRUE to maintain backward compatibility.

Benefit: Elimination of the extra IF activity.

image

Cheers

Hi @J0ska,

You can do it as the following:

If(Condition, valueTrue, valueFalse)

here is an example where I log the longest string
Capture

in your case try using:

if(listMessages.Count > 0, "processing email <" + objMessage.Subject + ">", String.Empty)

Cheers :upside_down_face:

1 Like

Thx for advice. It is smart workaround.
The only dark side is it still writes a LOG entry with empty message.

11:01:14.7160 Info {“message”:"",“level”:“Information”,“logType”:“User”,“timeStamp”:"2020-03-

My proposed approach would be useful in case you want log some warning message.

Cheers

2 Likes

Hi,
Thank you for your suggestion. I added it to our internal ideas tracker for our team to consider.

1 Like

This doesnt not make itself very needed because i guess we can already control this in orchestrator (in several places) if we want to log certain levels…

This is not about logging level (e.g. Trace, Info, Warn etc.) but logging certain events. E.g. log warning if input queue is over certain threshold and log nothing if below.

Indeed this is nice to have priority :slight_smile:

Cheers

Still you will need to acquire this boolean variable value to determine if you will log or not, this could be easily achivied now, if you create a sequence with a simple IF and the log inside… I understand why you want this, just for me it might not be so useful, control at the highest level like that is just quite painful to manage…

I do not like IFs :wink:

you will sure need them to use with that property…