We recently released a new version of powerJobs 2015 and talked about on this post. In the past week, we run webcasts where we showed the new features in action. We recorded the whole session, so in case you missed it, you can watch it here: Screencast – What’s new in powerJobs 15.1?
Today, I’d like to highlight one feature in particular, which is the extended JobProcessor UI.
This is how the JobProcessor looks like when delivered by Autodesk:
And this is how the JobProcessor looks like when started with powerJobs:
Underneath the JobProcessor window, you’ll notice an additional window that shows messages. It’s a log or trace window. It shows what is currently happening inside the job. It gives you transparency on the current operations, whether they are successful or facing an issue.
You can also save the logs into a file and send it then to your admin, reseller or to us for further analysis.
Looks good, right? But how does coolOrange do this? Are they changing the Autodesk JobProcessor code? Can I still rely on that thing? Will it change the behavior? What about compatibility?
All good questions, and the answers are simple: don’t worry!
The powerJobs executable is independent from the JobProcessor. The powerJobs.exe either starts the JobProcessor, or accesses a running instance, and simply “takes the screen” of the JobProcessor and embeds it into the powerJobs UI. So, the 2 applications are still independent from each other, however, they look as they are one. This way, no matter which improvements will come with the JobProcessor, powerJobs will not interfere.
Of course, you can run the JobProcessor without the powerJobs UI, and still benefit from the jobs that are delivered with powerJobs, such as the PDF creation or your custom jobs created with PowerShell. However, you will not benefit from the transparency and logging of the trace-window.
So, how do these messages come on the screen? With powerJobs 2015 we released a set of commandlets. Simple commands you can use within your PowerShell scripts. We spoke about this few weeks ago in this post and will talk more in future posts. The commandlet responsible for the logging is the Add-Log. The syntax is super simple:
Add-Log –Text “Your text here…”
Now, you can configure how much information you like to see either in the log-window and/or in the log file. For instance, you can edit the coolOrange.powerJobs.CreatePdfAsAttachment.ps1 file and add some more log messages.
By default, in the log file you will have only warnings, errors, fatal exceptions but no info messages. The Add-Log produces info messages, so by default, such messages will not be reported in the log file. This is intentional, so that as long as there is nothing critical, the log-file should remain almost empty. In case of troubles, the log-file will contain the according information.
In case you like to see more, either in the log-window or in the log-file, you can change the standard settings. Under c:\ProgramData\Autodesk\Vault 2015\Extensions\coolOrange.PowerJobs.Handler you’ll find the file coolOrange.powerJobs.dll.log4net. Just open this file with a notepad. You will find 3 appender sections:
<appender name="OutputDebugStringAppender" ... <appender name="rollingFile" ... <appender name="MsgAppender" ...
We are looking for the rollingFile, which is responsible for the log-file, and the MsgAppender, which is responsible for the messages in the log-window. Each appender has a <filter …> where the <levelMin value=”….”> defines what the minimum level of information is that we like to get reported. Now by default, the level for the rollingFile is set to WARN (warnings) so that the INFO messages (more verbose but les less relevant) are not reported to the log file. If you like to have the INFO messages in your log-file as well, just change WARN to INFO, like this:
<filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="INFO" /> <levelMax value="FATAL" /> </filter>
In a similar way, you can increase the verbosity of the log-window by editing the levelMin for the MsgAppender filter. By default it is set to INFO, which means that your Add-Log messages and also WARN, ERROR, FATAL would be reported. So this level is pretty good. If you like to see more, you may change it to DEBUG, which would fill up your screen with tons of messages coming from the source code. So, just for fun you may do a test, but you probably will switch back to INFO. Remember to restart powerJobs when you change the log4net file.
So, this is one new feature of powerJobs 2015. Next time I will talk about how to easily create new custom jobs.