Any issues if several gs.log is added in scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 08:39 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 08:51 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 08:52 AM
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
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 09:04 AM