Governance on Script Logging

NetSuite governs the amount of script execution logging that can be done. The governance model is as follows:

Use the N/log Module to access methods for logging script execution details.

Script owners are notified if NetSuite detects that a script is logging excessively and NetSuite automatically adjusts the log level. This ensures that the offending script continues to execute and helps prevent an inordinate amount of logging from one company. For example, Spruce Street Foods has 10 scripts running during a 60–minute time period. If one of the scripts calls log.debug(options) 70,000 times within each 20–minute time period, NetSuite will automatically raise the script's log level.

The change to the log level will appear in the Log Level field on the script's Script Deployment page:

Script Deployment page with Log Level of Audit highlighted.

If the offending script's log level was originally set to Debug, NetSuite will increase the level to Audit. This means that the log.debug line of code will continue to execute, however, nothing will be logged, because the log level for the script has been raised to Audit and the line of code is using the Debug level. For more information about log levels, see the help topic Using Log Levels. For more information about viewing script execution logs, see the help topic Script Execution Logs.

For more information, see N/log Module Guidelines.

Script Execution Logs

All script execution logs in NetSuite are stored for a maximum of 30 days. You can access script execution logs using the Execution Log tab, using a Server Script Log search, or using the Script Execution log page. Details are shown in the following table:

Access to Script Execution Logs

Details

  • Execution Log tab on script and script deployment records

The capacity for script execution logs on the Execution Log tab is shared by customers on the same NetSuite database. For further protection against excessive logging, script execution logs are governed by a total storage limit of 5 million logs on each instance of the database. If this limit is reached, all logs across all customers on that database are purged. If you require the ability to view all logs up to 30 days on the Execution Log tab, consider creating a custom solution using custom records to store log information from logs.

For more information, see the help topic Using the Script Execution Log Tab.

  • Server Script Log search

The capacity for script execution logs returned by the Server Script Log search is shared by all customers on the same NetSuite database. For further protection against excessive logging, script execution logs are governed by a total storage limit of 5 million logs on each instance of the database for this search. On each NetSuite server, if this limit is reached, logs across all customers on that server are purged. If you require the ability to search all logs up to 30 days, consider creating a custom solution using custom records to store log information from logs.

If a server script log search is not returning logs less than 30 days old, go to Customization > Scripting > Script Execution Logs and use the filters at the top of the Script Execution Log page to search for logs. You may also want to check script deployments that have large amounts of logging and consider lowering the Log Level to Error or Emergency or limiting the number of log lines in your script.

  • Script Execution log page

The execution logs shown on the Script Execution log page are stored for 30 days regardless of volume.

For more information about the Script Execution log, see the help topic Viewing a List of Script Execution Logs.

Script Owner Notifications

If NetSuite detects that a script is logging excessively, the owner of the script is notified that the script is logging excessively and could possibly exceed the 100,000 logging threshold (for a 60–minute time period).

NetSuite sends email notifications and adds a log entry to the script's Execution Log indicating that a script's log level has been increased. For more information about script execution log levels, see the help topic Setting Script Execution Log Levels.

Related Topics

General Notices