script logging not showing in eclipse workspace
I'm debugging a JavaScript-based validator and I am not getting the debug messages that I have put in.
validate: function(attributeId, workItem, configuration) {
//debug only right now
console.log('validator');
console.log(workItem.getValue(WorkItemAttributes.OWNER));
console.log(workItem.getValue(WorkItemAttributes.FILED_AGAINST));
var severity = "ERROR";
var message = "A work item owned by an individual must be Filed Against a team backlog. Set the Filed Against attribute to your teams' backlog ";
return new Status(Severity[severity], message);
//end debugging
I am just printing a few things in the console (I need to get the UUIDs of things that I don't know how to get to any other way than printing it).
I have verified that the validator is running because I am getting the error, and if can change the message, reload, and get the changed message, so I know it is running the right version of my script.
My workspace is c:\RTC4001\workspace
and I look in c:\RTC4001\workspace\.metadata\.log and I have no log messages appearing.
I know I've done this before and I have no idea why I can't find these. Can someone tell me where I went wrong?
Susan
validate: function(attributeId, workItem, configuration) {
//debug only right now
console.log('validator');
console.log(workItem.getValue(WorkItemAttributes.OWNER));
console.log(workItem.getValue(WorkItemAttributes.FILED_AGAINST));
var severity = "ERROR";
var message = "A work item owned by an individual must be Filed Against a team backlog. Set the Filed Against attribute to your teams' backlog ";
return new Status(Severity[severity], message);
//end debugging
I am just printing a few things in the console (I need to get the UUIDs of things that I don't know how to get to any other way than printing it).
I have verified that the validator is running because I am getting the error, and if can change the message, reload, and get the changed message, so I know it is running the right version of my script.
My workspace is c:\RTC4001\workspace
and I look in c:\RTC4001\workspace\.metadata\.log and I have no log messages appearing.
I know I've done this before and I have no idea why I can't find these. Can someone tell me where I went wrong?
Susan
Accepted answer
adding to what Ralph has already answered :
here is the location on the server where you will see the log in case the script was run on the server:
the attribute customization wiki article documents this, with a sample of logged message:
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
Using Firefox, you should be able to see the console.log messages on the console tab of Firebug. If it appears here, the client is executing on the client side and the local workspace .log will have it tapped. Some scripts executed as part of the save operation on the workitem would execute on the server and is captured in the server logs.
hope it helps.
here is the location on the server where you will see the log in case the script was run on the server:
JazzTeamServer/server/tomcat/work/Catalina/localhost/ccm/eclipse/workspace/.metadata/.log
for a websphere installation, you might want to check corresponding profile directory.
the attribute customization wiki article documents this, with a sample of logged message:
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
Using Firefox, you should be able to see the console.log messages on the console tab of Firebug. If it appears here, the client is executing on the client side and the local workspace .log will have it tapped. Some scripts executed as part of the save operation on the workitem would execute on the server and is captured in the server logs.
hope it helps.
One other answer
Some scripts run in the client, some in the server. Look into the workspace of the server Eclipse. See the Process Enactment Workshop Lab 5 for hints where to find it.
Comments
Ah, I guess the last script i was doing (calculated field) ran on the client as I saw it in my eclipse client vs this one is a validator, which I guess runs on the server.
For the scripts that log on the server, how do you look at the logs if you don't actually have access to the server? I can see the messages on my test server but not my production server.
If you are an admin you can download the logs in the diagnostics section.
You should develop on a test system anyway and only deploy the scripts on the production server, once they are working. You should switch off excessive logging on the production server I would probably wrap my code in a catch throw to only log fatal errors.