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.
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 Level | Description | Example Use |
|---|---|---|
| Debug | Shows all messages, suitable for testing only. | Use in development. |
| Audit | Records events that occur during script processing. | Useful for auditing actions. |
| Error | Logs only unexpected errors. | Critical for error tracking. |
| Emergency | Logs 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.
Frequently Asked Questions (4)
Can log messages for client scripts be viewed directly in NetSuite?
How can I retain logs longer than the 30-day period?
What limits are there on using the N/log module in NetSuite?
Does the ability to use log levels apply to both server and client scripts?
Was this article helpful?
More in SuiteScript
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category