- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @prachikomal ,
We can modify the time but keep in mind that it will impact the instance because logs are generated in huge numbers , but if this is fine for you , then you can go to sys_auto_flush table and there you can search for the syslog table and change the time from there change the age in seconds
Now coming to second question , Yes the logs are at instance level.
And coming to send the log to the Splunk you can you scripted rest API's and if you want to send only to splunk then ServiceNow has an app built and it is free of cost this will help in your case.
Store link : "https://store.servicenow.com/store/app/890cab2e1b246a50a85b16db234bcb17"
Useful article for choices of sending data from ServiceNow to other systems , link : "https://www.servicenow.com/community/servicenow-ai-platform-articles/data-integrations-from-and-to-s...
If this helped you please do mark it as helpful and accept the solution
Thanks,
Vishnu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks for the info! That's helpful. Is there a way that we can modify the persistence of logs? Additionally will all of the logs will be at an instance level? I also want to forward these logs to external systems like splunk for monitoring.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @prachikomal ,
We can modify the time but keep in mind that it will impact the instance because logs are generated in huge numbers , but if this is fine for you , then you can go to sys_auto_flush table and there you can search for the syslog table and change the time from there change the age in seconds
Now coming to second question , Yes the logs are at instance level.
And coming to send the log to the Splunk you can you scripted rest API's and if you want to send only to splunk then ServiceNow has an app built and it is free of cost this will help in your case.
Store link : "https://store.servicenow.com/store/app/890cab2e1b246a50a85b16db234bcb17"
Useful article for choices of sending data from ServiceNow to other systems , link : "https://www.servicenow.com/community/servicenow-ai-platform-articles/data-integrations-from-and-to-s...
If this helped you please do mark it as helpful and accept the solution
Thanks,
Vishnu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Okay, thanks for the information. I can't open the link shared by you. Can you share the name here?
