Reading Runtime Logs (HOW-TO)
The ability to read runtime logs can greatly benefit you while you are troubleshooting automation issues.
However, looking at thousands and thousands of lines can be a daunting task. Please see the below guide on how I approach reviewing runtime logs.
MAKING SENSE OF THE LOG MESSAGES:
The biggest thing to keep in mind is that not every single line in the log matters. In fact, there are only around 5 sets of lines that I look for when first reviewing a log. These are all the lines that contain any of the following text:
- ExecutionLink
- propagating From:
- Control is matched.
- Control is detached
- General Information
ExecutionLink lines show you when an execution link has been processed ( these are the yellow lines in your automation ). The line will look something like this:
Info | {Time of execution} | {Thread #} | MTA | Automation | {Automation Name} | {Project Name} | Automation: {Automation Name} - ExecutionLink From: {someControlName.someMethodName} To: {someControlName.someMethodName} ID: {Just some ID}
propagating From: lines show you when a data link has been processed ( these are the blue lines in your automation. The line will look something like this:
Info | {Time of execution} | {Thread #} | MTA | Automation | {Automation Name} | {Project Name} | Automation: {Automation Name} propagating From: {someControlName.someValueProperty} To {someControlName.someValueProperty} Value: {The value that was passed}
Control is matched. lines show you when a control has been matched. The line will look something like this:
Info | {Time of execution} | {Thread #} | STA | Adapters | {Adapter Name} | {Control name}-{Some # I don't care about} | Control is matched. Target: HWND:{Some window handle}, ParentTarget: HWND:{Some window handle}
Control is detached lines show you when a control has been detached (unmatched). The line will look something like this:
Info | {Time of execution} | {Thread #} | STA | Adapters | {Adapter Name} | {Control name}-{Some # I don't care about} | ControlBase.Detach(destroyControl:True) - Control is detached
General Information lines show you when an exception has occurred. The line will look something like this:
Error | {Time of execution} | {Thread #} | MTA | Exception | | | {Exception message}., Verbose Message: General Information
HOW I REVIEW LOGS
Notepad++ is my text editor of choice but any editor should be sufficient for reading logs (file size may become a factor).
To start, I like to mark all of the lines I mentioned above and copy them into a new file. This helps remove a lot of the clutter that I normally won't care about. Plus, in the case when I need more information from the full log, I can always go back and view lines around specific areas I pinpointed in the filtered log.
This process, Notepad++, looks like this (other text editors may be similar):
- Select the 'Search' tab.
- Click 'Find'
- Select the 'Mark' tab.
- Select the 'Bookmark line' checkbox.
- Enter "ExecutionLink" in the 'Find what:' textbox.
- Click 'Mark All' --- NOTE: depending on file size this may take a while
- Enter "propagating From:" in the 'Find what:' textbox.
- Click 'Mark All' --- NOTE: depending on file size this may take a while
- Enter "Control is matched." in the 'Find what:' textbox.
- Click 'Mark All' --- NOTE: depending on file size this may take a while
- Enter "Control is detached" in the 'Find what:' textbox.
- Click 'Mark All' --- NOTE: depending on file size this may take a while
- Enter "General Information" in the 'Find what:' textbox.
- Click 'Mark All' --- NOTE: depending on file size this may take a while
- Close the 'Find' window.
- Select the 'Search' tab.
- Click 'Bookmark'
- Click 'Copy Bookmarked Lines' --- NOTE: depending on file size this may take a while
- Select the 'File' tab.
- Click 'New'
- Paste copied content into newly opened file.
- Celebrate!
Bonus: At this point you can style (color) words/phrases to make the log even easier to read.
- Highlight a word.
- Right-Click
- Select 'Style token'
- Select a style
Extra Information
- Not all exception are 'bad'. Benign exceptions do exist.
- Knowing when a problem happens helps you while reviewing logs.
- At the top of the log you will see a line with the text "OpenSpan assembly version". This line shows you what version of the product the user is using.
- If you search for the text "Extracted deployment project". This line shows you the name and version of the deployment package the user is using.
- Often time developers add their own custom log messages in the solution. You should be aware of these messages and be sure to mark their patterns as well.
***Updated by moderator: Lochan to add FAQ Group Tag***