How to write all the log messages into an excel sheet and also append the next log messages?

studio
logs

#1

Hi Guys,

I wanted to know how do we write all the log messages into an excel sheet and also append the new log messages.

Regards
A.Srish


#2

Hey @srishsai

you can do via one simple way is create a datatable with suitable column and add all your log messages their then finally write that datatable into an excel :slight_smile:

Regards…!!
Aksh


#3

Hi @aksh1yadav

My requirement is the client wants to see what is happening in the bot ,
without disturbing the bot ,he wants to notice that bot has gone through till which step and wants to see it parallely,so i want to update the excel as well as soon as the logmessage is triggered parallely append the next ones as well

your solution i guess it would add the log messages all at once at the end if am right?if yes then i need to do it after each step and update the excel

Regards
Srish


#4

so that excel will be where? you are performing unattended or attended?


#5

Hi @aksh1yadav
It Would be an unattended bot and the excel will reside somewhere outside the project folder where we invoke the shared drive path and place the logs respectively after each activity completion
can we have it parallely append the new logs as well into the same excel after each activity?
what is the approach to do it?

Regards
A.Srish


#6

@srishsai your still on planet earth. hahah :smile:


#7

Hi @ddpadil,

do you know the solution for the above asked Question?

Regards
A.Srish


#8

I’d rather say no to you. Since guy is already assisting you on this.
Wait for response. :wink:


#9

There are things… Even if we can write data into the excel or file in the background but that will not update the data.
For example if you will write even in excel via odbc connection as well and you will open the excel first of all it will open as a read only mode because file will be locked for writing. and even by using query you will insert data but it will only reflection when execution of your bot will end.

and even same thing with txt files as well. you have to reopen file to see the updated changes because data will update in the background …

Regards…!!
Aksh


#10

Hi ,

Is there any other was as we see the log messages updating in the studio
in the similar fashion where the logs gets updated dynamically

Regards
A.Srish


#11

Well …nothing is coming right now in my mind … work also is there…there is one thing coming in my mind but that will be too much the mail send :slight_smile: but that is not a feasible way at all :slight_smile:

or on other system you can use filewatcher or monitor the changes and can show the new added message via callout(if you wnna use uipath there too ) everytime

lets see some other perspective on your question @andrzej.kniola -mate …any words on this?

Regards…!!
Aksh


#12

@andraciorici @Lavinia @AndrewRayner


#13

If you’re working with files you need something that will refresh the view.

If your client wants to see what’s happening there’s a couple options:

  • Give them access to Orchestrator (just the Logs view) - that’s the easiest option
  • Configure a second source in NLog.config (located in your installation folder), see here for details in NLog configuration. I wouldn’t use excel though, probably CSV or just leave it as is. Do note that as @aksh1yadav wrote you don’t want to lock the file - use f.e. Notepad++ for reading it, as it can open without locking easily (that’s the default) and reload with a press of a button.
  • Add a second logger and call it from your workflow. This is also achievable from NLog.

Personally I’d probably go with first or second option, but that’s just me.

What you could also do is talk with your client - what do they really want? From my experience customers rarely want full logs, more like reports. If they really do want to see full logs “just because”, you have a trust problem and that I can’t help with.


#14

@andrzej.kniola
Thanks for the info but the client wants to see parallelly when the bot is running the custom log messages written by the developer as the orchestrator is also the option but i wanted to know is there anyway where he has shared path on to which he has excel or Csv
Anyways Nlog i would certainly try that as well,
Thanks

Regards
A.Srish


#15

Here is a way you can try…

-Have the status messages update in a table in a DB on the runtime.

  • And on the sidelines create a Excel view (with macro) for the client. The excel should have connection with db that you have live updates going on. Create a Refresh button in excel to refresh and provide the updates,
  • Whenever the Client/user wants to view the status, all he has to do is hit refresh button.

Thanks,
Anil


#16

Hi @Anil_Fernandes

Thanks for the idea ,i would certainly try that out
any doubts i would get back to you
Regards
A.Srish


#17

Hi
If it is only certain steps you want to update the user with, a quick workaround is as below:

  1. At key points in the process assign a log message to a variable (e.g. 1st file processed)
  2. Before the next step, add the variable to a datatable
  3. Append the datatable to a csv file on the shared drive
  4. Move on and repeat

The user can then access this csv on the shared drive, and track progress.

NOTE: They must not open the csv file directly from the shared drive, or the bot will not be able to post to it. They must Copy and Paste it to their local machine before opening.

This isn’t an ideal solution, but for transactional work with key update points it does provide a good point in time view for the user

You can even name the csv file using part of your timestamp, producing a new log file every hour for example

Hope this helps / sparks a more robust approach


#18

You could also use the Preview pane in File Explorer which shows the data and won’t interrupt the writing process.

One thing I have done before is use a prefix on the results/log filename that shows the process is running basically, then remove the prefix when it is complete. That way the customer knows that the robot finished successfully.

Personally, I find using text files easier and you can open it while the writing process is running. But I guess it depends on the data you are logging. If it contains many fields then maybe CSV or Excel is better, but if it’s just a Process Log and Report then Text-based extensions could be considered.