Any issues if several gs.log is added in scripts?

Suggy
Giga Sage

I see that in many scripts our developers are using several gs.log()

From a best practice standpoint, is it fine to add as many as gs.log()? any performance issues? or is it fine? 

3 REPLIES 3

Prince Arora
Tera Sage
Tera Sage

@Suggy 

 

We can use gs.log() in the script for debugging, but it will create a lot of entries in the system logs table.

 

For example, there is a catalogue item and in the workflow script, we have added 10 logs to it. If 20 users use the catalogue item every day, 200 logs will be generated in the logs table, and this will import entries into the database, which tends to unwanted entries in the database and that tends to performance issue.

 

Also, if the script is related to integration, make sure not to print sensitive information in the logs such as API/secret keys (just an example)

 

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Ahmmed Ali
Mega Sage

Hello @Suggy 

 

You can add any number of log statements in script, but only for non-prod instance for debug purpose. It is recommended to avoid logging in production as it creates huge data in log table.

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

miro2
Mega Sage