Logs in Mid Server Script File
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 12:31 PM
Hi,
Any idea on adding logs in Mid Server Script Files.
For example, there is OOTB script - ActiveDirectory.psm1 and have log messages - SNCLog-ParameterInfo and SNCLog-DebugInfo. I wanted to check the output of these logs. Anyone know where these logs will be displayed. Is there any property that needs to be activated to display logs. Or any other method to debug PowerShell script present here.
Thanks,
Sagar
- Labels:
-
Orchestration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 12:45 PM
I don't know if these will work in the specific one you want but ms.log is typically how you output to mid server logs for scripts that are running on the mid server. Hope this helps and if it does mark as correct answer. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 01:32 PM
You can add logs in the MidServer files by using ms.log("Log Statement");
These logs will be printed in MidServer logs files. In case you need to view those logs, goto the MidServer record and use the UI Action "Grab MID logs"
https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/product/mid-server/task/t_AccessMIDServerLogsECC.html
Note: If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 05:58 AM
You have to change configuration parameter mid.property.powershell.log_info for your MID server to true.
Then the logs should become visible in ECC queue inputs under log_info tag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 03:21 AM
@Andrzej Krawcz1 Correct
List of all logs can be found under [ecc_queue.list]
For example, if you need Powershell file execution output
1. GoTo > ecc_queue.list
2. Topic=powershell,
3. Agent=<your_mid_server>
Open the desired record and check the Payload section with all your "echo" logs getting executed.
Thanks