N/log Module for Script Execution Logging in NetSuite

The N/log module in NetSuite enables effective logging of script execution details, enhancing debugging and monitoring capabilities.

·2 min read·View Oracle Docs

The N/log module is a crucial tool in NetSuite that allows developers to log details about script execution efficiently. This capability is particularly essential for debugging and maintaining scripts to ensure they function as intended.

What is the N/log Module?

The N/log module provides methods to facilitate logging within SuiteScripts. Developers can utilize both the N/log module and the global log object to record relevant execution information.

How to Access the N/log Methods

Logging methods can be accessed through the following methods:

  • Use the log object directly for running scripts.
  • Use the N/log module for more detailed control and configuration.

Log entries generated using the N/log module can be viewed in various interfaces, such as:

  • Execution Log subtab of the script deployment record.
  • SuiteScript Debugger during script debugging sessions.
  • Script Execution Logs page under Customization > Scripting > Script Execution Logs.

Guidelines for Using the N/log Module

When using the N/log module, here are some essential guidelines to keep in mind:

  • Each company is limited to a maximum of 100,000 log object method calls within any 60-minute window across all scripts. Exceeding this limit will prompt NetSuite to automatically adjust the logging level for scripts detected to be logging excessively.
  • Logs that are older than 30 days will be purged automatically by NetSuite.
  • The storage limit for logs in the Server Script Log and Execution Log subtab is capped at 5 million per database instance. Since log persistence isn’t guaranteed, consider using custom records for long-term log storage.
  • Note that the Execution Log subtab documents not only log entries but also any system messages or errors returned by NetSuite. For comprehensive error handling, refer to the N/error module.

Additional Resources

For more details on error handling and logging practices in NetSuite, consider reviewing the corresponding sections on the N/error module and its members. This can provide further insights into managing errors and ensuring better control over your scripts' execution flows.

Frequently Asked Questions (4)

How can I view logs generated by the N/log module?
Log entries created with the N/log module can be viewed in the Execution Log subtab of the script deployment record, the SuiteScript Debugger, or the Script Execution Logs page under Customization > Scripting.
What logging limits does NetSuite impose when using the N/log module?
NetSuite limits each company to 100,000 log object method calls within any 60-minute period across all scripts. Exceeding this may cause an automatic adjustment of the logging level.
What happens to logs that are older than 30 days in NetSuite?
NetSuite automatically purges logs that are older than 30 days. For long-term log storage, consider using custom records since log persistence is not guaranteed.
Does the Execution Log subtab in NetSuite only document log entries?
No, the Execution Log subtab also documents any system messages or errors returned by NetSuite, not just log entries. For comprehensive error handling, it is suggested to refer to the N/error module.
Source: In This Help Topic 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 →