Logging to newly created Log Field

logs
logging

#1

Hi,

I need help with the log message/add log field activity. I am trying to log detailed logs to kibana for monitoring, but struggle to get it to work the way I want.

Right now, when you start a process, you get the logs under “Message” which will say “process started”, “logs from the log message activity” and then “process ended” …

all on seperate lines. What I want is seperate lines for each log, but in a different field. So if i add a new log field, I’d like to log to that field (let’s call it “NewField” ) and not to the message field which is standard.

How can i log messages/variables in a loop for example to this NewField ?

In the end, i would want to create a field for each input variable used so that i can log the used inputs per loop giving me a good overview of which inputs have been used per loop


#2

So the add log fields activity does exactly that, creates a new field within the standard log message that is sent to the Elastic Search Server. You can’t as far as I know, simply log one field. However the way that Kibana works is to use that new field as an index so it’s very easy and quick to effectively filter on that particular piece of data.

Sorry if that’s too simplistic and doesn’t answer your question. Please elaborate if needed.

RD


#3

Hi @vBaustad,
i hope i have understand your problem
And i think this is a solution.


#4

Hi, thanks for the help. I actually figured out a way to do it.

image

In the end of the loop, I add the log fields with the variables, then also add a log message so that the fields will be written to that new log line (When adding log fields, they will be written together with the log messages every time. I basically just write one log message with the attached fields and variables, then removing the log field variables so i can add new ones next loop).


#5

Hello @vBaustad,

I was also trying to add custom fields. But the ‘remove log fields’ probably is not working for me or I am not using it in the right way. The issue I am facing is, even after the ‘remove log fields’ activity, the subsequent Log messages are showing the custom fields added. Have you got this scenario in your work flow? Do you mind attaching your xaml to see the way the ‘Remove log fields’ activity is used?

Regards,
Shiju Mathew


#6

Please see attached the add and log fields activities from the UiPath ReFramework. The errors are just due to the variables not existing.

Hope this works for you.

RD

Main.xaml (6.0 KB)


#7

Hi ,
Create a variable a “in_Config” and variable type is “Dictionary<String,Object>”. I hope it will work fine.

Thank you
Balamurugan.S


#8

Thanks @richarddenton, @balupad14, I could now make use of custom log fields with your valuable inputs.

Regards,
Shiju Mathew


#9

Very Nice…