cancel
Showing results for 
Search instead for 
Did you mean: 

Find Webscript name from log

sakshik
Star Contributor
Star Contributor

I have the following entry in catalina.out

Can I know which webscript is called by looking at this entry?

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

You cannot determine the calling web script from a log entry like this alone, unless the code that does the logging - or the logging framework itself - does some stack analysis to determine the caller / context. Since Alfresco does not provide the name / ID of the currently executing web script in some thread-local data structure, you would have to do some invasive thread stack + variable state analysis, which might even require use of JDK internal APIs...

A simple albeit "dumb"-fire approach is for the code that logs to create a new exception and use that exception object to get to the current stack trace. But that won't give you the name / path of the JavaScript file if you are being called from a JavaScript-backed web script (which in your case is the case since we are talking about a script extension).

Long answer short: You could determine the calling web script, but the cost / complexity is too great...