Adding Dynamic log Field

Hi All ,
i am aware “Add log fields” activity is the one which is responsible to add new fields to logs . it takes collection as inputs. but the value for this is given static way , How about passing some collection as arguments so that today 12 fields of logs can be added and tomorrow 20 fields can be added. in this way we can avoid touching the code for just adding a new log field . rather have a place in config file where these field names are added.

1 Like

Hi
Yah that’s possible
We can use List kind of variable to take in different set of values in the collection variable
But I would suggest to keep always the same because when we run once and look for a log in the details tab in orchestrator m, we might expect for the same in later testing and if we change the log field it won’t be a robust way to handle to the logs and it’s information

Cheers @karges

well its as much same as config file. unless no one changes its difficult. there are valid reasons to do in this way.
one : the way the KPIs are defined are unpredictable especially time saved by the bot . some times this time saved is split in to various categories . (after the bot development) .
two : obvious reason , “please include one more field” .(after the bot development)!
thanks @Palaniyappan for the input .

1 Like

Hi, do anyone have a solution for how this could be achieved? I have a json object that I want to loop through and use AddLogFields for each pair found, but I have not found a way on how I can use the key value as the name of the log field.

image

What I want is to use the item.Name as the log fields name, so I need to find a way to reference to this variable rather then it ending up like this
image

any ideas?

hi, did you find any solution to this, your case sounds exactly same as the one we face, and for same reason we are looking for a solution aswell…

I’d like to bump this question! Is there any way to add and remove log fields dynamically? I feel like either the current logging capabilities are a bit too narrow for our needs, or I am missing some functionality to make it more useful/less cumbersome.

1 Like

I’m facing the same issue, I want to create a dynamic way to add log fields based on a new Config.xlsx sheet I made for this purpose.

The idea is placing this new feature in our custom REFramework, so the devs can set the log fields and the key/value references for that specific process, making all that info goes to Elastic Search to generate dashboards in Kibana.

Without this dynamic way to create log fields we would have to drop this feature for now, or create our own logging system…

I saw that a new parameter called ArgumentsVariable was added to the Start Job activity, it’s a Dictionary<String,Object>, we would need the same thing for the Add Log Fields activity to make it dynamic.
image