Understand loggin for traceability in platform.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi team,
We have an application on the servicenow platform, which is currently in development phase- goal is to assess how logs can be captured, structured, and stored centrally within the platform for better traceability and analysis.
Currently, the application relies on browser-based console logging (console.log, console.warn, console.error) to capture warning and error messages. These logs are ephemeral, not persisted, and lack centralized visibility, making debugging and monitoring difficult in non-development environments.
Also, I want to understand if there are any time periods for which the logs will be persisted for in syslog or other tables per instance.
I also want to understand options for forwarding logs to external systems like Splunk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @prachikomal ,
Replacing Console Logging with Platform-Native Logging console.log/warn/error are purely browser-side they're only useful during active UI development. For a production application, you should move to server-side structured logging using ServiceNow's native APIs.
gs.log("Informational message", "MyApp"); // writes to syslog (info)
gs.warn("Something unexpected", "MyApp"); // writes to syslog (warning)
gs.error("Something failed", "MyApp"); // writes to syslog (error)
gs.debug("Debug detail", "MyApp"); // only visible if node-level debug is enabled
The data in the syslog table will be stored for 7,776,000 second (i.e 90 days)
If this helped you please do mark it as helpful and accept the solution
Thanks,
Vishnu
