I know where this exception is coming from, but if I didn't, I would struggle to identify it. How would I diagnose which View is having an issue from this log exception if I didn't know already which it relates to? (imagine the message is very generic and could apply to a vast number of scripts and views). There's no context whatsoever in the log to identify the specific View. I can see the project name and that it's for a Perspective View, but that's about it for the context.
Click on the magnifying glass for extra context keys.
That just gives me the project. Hmm, although I'm running in the Designer. I can see some other logs with the view in there
I would expect to see useful MDC values in designer or a real session, though it's possible they're not getting set up for property change scripts.
com.inductiveautomation.perspective.ComponentModel
on TRACE will be unfortunately noisy, but should have a very useful logged message for each property change event fired:
log.tracef(
"Property change script %s.%s. origin=%s, qv=%s (%sms)",
component.getQualifiedPath(),
target,
origin,
qv,
NANOSECONDS.toMillis(System.nanoTime() - start)
);
Ok, running it in the browser I can see that it has a view under the mag glass, but more often than not is says it's coming from the navigation bar view and not the main view that it's located in...
I was just earlier this week trying to track down something like this and was watching MDC values and everything else I could. I found my particular binding very quickly, but then kept experimenting a bit more...
I actually found that the same property binding on a session.custom
property was inconsistent whether it had MDC values provided in the script or not, and when it did have them the view
property was varied. Which, sort of makes sense since a session-scoped property is not part of any one view, but would be very confusing if trying to trace a script exception back up like @nminchin was doing.