diff --git a/job.cpp b/job.cpp
index 9d02977..7b80ba4 100644
--- a/job.cpp
+++ b/job.cpp
@@ -320,9 +320,15 @@ int Job::Execute()
 
 		wxString stepstatus;
 		if (rc == 0)
+		{
+			LogMessage(wxString::Format(_("Script result: 0, setting stepstatus to \"s\"")), LOG_DEBUG);
 			stepstatus = wxT("s");
+		}
 		else
+		{
+			LogMessage(wxString::Format(_("Script result: %d, setting stepstatus to \"%s\""), rc, steps->GetString(wxT("jstonerror")).c_str()), LOG_DEBUG);
 			stepstatus = steps->GetString(wxT("jstonerror"));
+		}
 
 		rc = threadConn->ExecuteVoid(
 		         wxT("UPDATE pgagent.pga_jobsteplog ")
