What It Does
The gs.info() method writes messages to ServiceNow's application log at the INFO level. Unlike debug or error messages, INFO level logs are always written regardless of debug settings, making them suitable for production logging of important application events.
Internally, ServiceNow processes the message through its logging subsystem, applying any configured log filters and routing rules. The message gets timestamped, tagged with the current user context, and written to the syslog table where it's accessible through System Logs → System Log → App Logs.
The method returns void (undefined in JavaScript terms) and never throws exceptions, even when passed invalid parameters. If the message parameter is null or undefined, ServiceNow logs an empty string. Parameter substitution uses zero-based indexing with curly brace notation: {0}, {1}, etc.
Edge cases include behavior when substitution tokens don't match provided parameters. Unused tokens remain as literal text in the final message, while extra parameters beyond the highest token index are ignored. Object parameters get serialized using JSON.stringify() when possible, falling back to [object Object] for complex objects that can't be serialized.
This method is part of the GlideSystem logging family alongside gs.log(), gs.warn(), gs.error(), and gs.debug(). The key difference is that gs.info() includes built-in string substitution and is the recommended choice for scoped applications.
When to Use This
Use gs.info() when you need to log important application events that should always be recorded, such as successful integrations, user actions, or workflow completions. This is the correct method for production logging where you need visibility into application behavior without the verbosity of debug logs or the alarm-level nature of error logs.
Choose gs.debug() instead for temporary troubleshooting messages that should be filtered out in production. Use gs.error() for genuine error conditions that require attention. Avoid using gs.log() in scoped applications since it doesn't support message substitution and creates less organized log entries.
Common misuse includes logging sensitive data like passwords or API keys, logging inside tight loops without throttling, and using INFO level for debugging messages that should use DEBUG level. Resist the temptation to log every variable value during development - use appropriate log levels to keep production logs clean.
Return Value
The method returns void (JavaScript undefined) in all cases. The method never fails or throws exceptions, even when passed invalid arguments or when the logging subsystem encounters errors. This fire-and-forget design prevents logging code from breaking your business logic.
Since there's no return value to check, you cannot programmatically determine whether the log message was successfully written. If you need confirmation that logging occurred, check the System Logs manually or use a custom logging solution that provides feedback.
Enjoying this? Get one deep-dive per week.
Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.
Platform Behavior & Side Effects
- Creates a record in the
syslogtable with level 'INFO', source script name, and full user context - Does not trigger Business Rules, ACLs, or notifications - logging is considered a system-level operation
- Performance impact is minimal but accumulates - each call requires string processing and database write
- Works identically in all server-side contexts - Business Rules, Script Includes, Scheduled Jobs, and UI Actions
- Log entries are subject to ServiceNow's automatic log rotation and cleanup policies - typically 7-30 days retention
- In scoped applications, log entries are tagged with the application scope for easier filtering
- Messages longer than 8192 characters are truncated without warning or error indication