Script Execution Logs Management in NetSuite

Manage and view script execution logs in NetSuite effectively using the N/log module and the Script Execution Logs page.

·3 min read·View Oracle Docs

Log messages play a crucial role in tracking and debugging scripts within NetSuite. This guide covers how to effectively view and manage script execution logs using the N/log module and the Script Execution Logs page.

What is the N/log Module?

The N/log module in NetSuite provides methods for logging script execution details. You can access these methods using the global log object as well. The log messages generated appear in various places, including the Execution Log subtab of the script deployment and the SuiteScript Debugger.

Viewing Script Execution Logs

How to Access Logs

Log messages for a specific script can be found in the Execution Log of the script deployment. Additionally, all server scripts and deployed client scripts' logs are accessible in the Script Execution Logs via Customization > Scripting > Script Execution Logs. Keep in mind that logs older than 30 days may not be preserved.

Tasks You Can Perform

On the Script Execution Logs page, users can:

  • Search for specific logs using various filter options such as log level, execution date range, and script name.
  • Download the logs to a CSV file or an Excel spreadsheet.
  • Print the list of logs.

Important Notes

  • Log messages from client scripts that are attached to a form can only be viewed in the browser’s debug console.
  • Server script logs and those from client scripts deployed at the record level will show in the NetSuite interface.

N/log Module Guidelines

Adhere to the following guidelines when utilizing the N/log module:

  • NetSuite permits a maximum of 100,000 log object method calls in a 60-minute window across all scripts.
  • The log storage limit is capped at 5 million logs for each database.
  • Consider using custom records for long-term logging, as logs in the Execution Log page do not guarantee persistence.

Log Levels Explained

Different log levels filter the information captured in the logs:

Log LevelDescriptionExample Use
DebugShows all messages, suitable for testing only.Use in development.
AuditRecords events that occur during script processing.Useful for auditing actions.
ErrorLogs only unexpected errors.Critical for error tracking.
EmergencyLogs only severe errors.Important for critical failures.

By selecting appropriate log levels, you can control the granularity of the log outputs to match your debugging or auditing needs. Be cautious with the Debug level in live environments to avoid excessive output.

Conclusion

Utilizing the N/log module effectively ensures you can monitor script execution closely and respond promptly to issues as they arise. By leveraging the Script Execution Logs page, you gain a powerful tool to improve your scripting processes in NetSuite.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Can log messages for client scripts be viewed directly in NetSuite?
Log messages from client scripts attached to a form can only be viewed in the browser’s debug console. However, server script logs and those from client scripts deployed at the record level are visible in the NetSuite interface.
How can I retain logs longer than the 30-day period?
To retain logs longer than the 30-day period offered by the Execution Log page, consider using custom records for long-term logging, as these logs are not guaranteed to persist.
What limits are there on using the N/log module in NetSuite?
NetSuite allows a maximum of 100,000 log object method calls in a 60-minute window across all scripts and has a log storage limit of 5 million logs per database.
Does the ability to use log levels apply to both server and client scripts?
Yes, the ability to use log levels to control the granularity of log outputs applies to both server and client scripts. Selecting appropriate log levels helps manage debugging and auditing needs effectively.
Source: Viewing Script Execution Logs Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in General

View all General articles →