AnsweredAssumed Answered

log4j Debugging Javascript in Workflow

Question asked by hyperation on Nov 10, 2009
Latest reply on Nov 11, 2009 by hyperation
Hello,

I am having trouble trying to enable log4j logs to appear in console or log files.

I modified the example AdHoc workflow a bit by adding logger.log lines:

   <task-node name="adhoc">
      <task name="wf:adhocTask" swimlane="assignee">
         <event type="task-create">
            <script>
             logger.log("Test DEBUG MODE 1");
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
      </task>
      <transition name="" to="completed">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
           logger.log("Test DEBUG MODE 2");
              if (wf_notifyMe)
              {
                 var mail = actions.create("mail");
                 mail.parameters.to = initiator.properties.email;
                 mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
                 mail.parameters.from = bpm_assignee.properties.email;
                 mail.parameters.text = "It's done";
                 mail.execute(bpm_package);
              }
           </script>
         </action>
      </transition>
   </task-node>
  

I've enabled DEBUG on the log4j.propertoes file:

log4j.logger.org.alfresco.web.scripts=debug
log4j.logger.org.alfresco.repo.jscript=debug
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

But when I initiate the workflow in the default Alfresco UI there is nothing being logged.  The workflow goes through correctly in each state.  I see values like wf_notifyMe being populated in the Javascript Debugger.

Can someone please tell me what I did wrong or did not do so I can enable logging in the console?

Thanks
:)

Outcomes