cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract, save and send process logs automatically?

RonAng
Level 5
Is there a way somewhere in the process or BO, that it extracts the BP process logs then save it to a text or csv file then send it via e-mail?
7 REPLIES 7

John__Carter
Staff
Staff
Not really. The Archive functionality can extract logs to flat files, but it's not designed to be part of a process. In theory you could query the DB directly but that would probably compromise your security model and put your DB at risk. Similarly, sending out potentially sensitive data via email is insecure. The logs are very dense and verbose, and I would question their value to the uninitiated. Maybe a better approach would be to create a bespoke log that 1) you can control the content and 2) access more easily?

There is definitely a value in being able to extract the logs. The logs are sent to the process owners and operations team and sent over the SMTP server.
Developer should have visibility of the product runs in order to make sure that the job that they pushed to production runs as expected. Do you know the SQL query that is fired at the DB?

------------------------------
Sandeep Satish
IT Architect
Agilent Technologies
Asia/Kolkata
------------------------------

This is the SQL query I use for parsing logs, based on session number:
Select seqnum, stagename, processname, pagename, objectname, actionname, Result, startdatetime From BPASessionLog_NonUnicode Where SessionNumber = <session number here>

------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------

david.l.morris
Level 15
Have you considered Data Gateways. I still haven't tested this specifically, but last I saw you could choose to have Data Gateways send to text files. Not sure how flexible it is or anything, but it's something to look into.

Edit: I just noticed this post was resurrected from 2017. So, disclaimer, Data Gateways weren't available back then.

------------------------------
Dave Morris
Cano Ai
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company

@Nicholas Zejdlik - Thanks a lot for sharing the query. Kindly suggest if there is a similar query to monitor log size created within a session? We want to monitor how much log size is one session of process generating to accordingly optimize logs. ​​​

------------------------------
Mayank Goyal
------------------------------

I think this should do it, I adapted from this StackOverflow answer. You may need to switch the table name based on whether or not your logs are unicode (BPASessionLog_NonUnicode vs BPASessionLog_Unicode). You can also join with the BPASession and BPAProcess tables if you would like the process name as well.

Select
sessionnumber,
Sum(
IsNull(DataLength(sessionnumber), 1)
+ IsNull(DataLength(seqnum), 1)
+ IsNull(DataLength(stageid), 1)
+ IsNull(DataLength(stagename), 1)
+ IsNull(DataLength(stagetype), 1)
+ IsNull(DataLength(processname), 1)
+ IsNull(DataLength(pagename), 1)
+ IsNull(DataLength(objectname), 1)
+ IsNull(DataLength(actionname), 1)
+ IsNull(DataLength(result), 1)
+ IsNull(DataLength(resulttype), 1)
+ IsNull(DataLength(startdatetime), 1)
+ IsNull(DataLength(enddatetime), 1)
+ IsNull(DataLength(attributexml), 1)
+ IsNull(DataLength(automateworkingset), 1)
+ IsNull(DataLength(targetappname), 1)
+ IsNull(DataLength(targetappworkingset), 1)
) session_log_size
From
BPASessionLog_NonUnicode
Group By
sessionnumber

------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------

Getting an error when joining to know which process is consuming maximum space. Could you please provide to query to find out which process is logging maxiumum

------------------------------
Saiful Khan
------------------------------