ce18aa
diff --git a/scheduler/log.c b/scheduler/log.c
ce18aa
index b6226201f..cdb5437dc 100644
ce18aa
--- a/scheduler/log.c
ce18aa
+++ b/scheduler/log.c
ce18aa
@@ -565,56 +565,15 @@ cupsdLogJob(cupsd_job_t *job,		/* I - Job */
ce18aa
   if (level > LogLevel && LogDebugHistory <= 0)
370473
     return (1);
370473
 
ce18aa
-#ifdef HAVE_SYSTEMD_SD_JOURNAL_H
370473
-  if (!strcmp(ErrorLog, "syslog"))
370473
-  {
370473
-    cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest) : NULL)) : NULL;
370473
-    static const char * const job_states[] =
370473
-    {					/* job-state strings */
370473
-      "Pending",
370473
-      "PendingHeld",
370473
-      "Processing",
370473
-      "ProcessingStopped",
370473
-      "Canceled",
370473
-      "Aborted",
370473
-      "Completed"
370473
-    };
370473
-
370473
-    va_start(ap, message);
370473
-
370473
-    do
370473
-    {
370473
-      va_copy(ap2, ap);
370473
-      status = format_log_line(message, ap2);
370473
-      va_end(ap2);
370473
-    }
370473
-    while (status == 0);
370473
-
370473
-    va_end(ap);
370473
-
370473
-    if (job)
370473
-      sd_journal_send("MESSAGE=%s", log_line,
370473
-		      "PRIORITY=%i", log_levels[level],
370473
-		      PWG_Event"=JobStateChanged",
370473
-		      PWG_ServiceURI"=%s", printer ? printer->uri : "",
370473
-		      PWG_JobID"=%d", job->id,
370473
-		      PWG_JobState"=%s", job->state_value < IPP_JSTATE_PENDING ? "" : job_states[job->state_value - IPP_JSTATE_PENDING],
370473
-		      PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0),
370473
-		      NULL);
370473
-    else
370473
-      sd_journal_send("MESSAGE=%s", log_line,
370473
-		      "PRIORITY=%i", log_levels[level],
370473
-		      NULL);
370473
-
370473
-    return (1);
370473
-  }
ce18aa
-#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
ce18aa
-
370473
  /*
ce18aa
   * Format and write the log message...
ce18aa
   */
ce18aa
 
ce18aa
+#ifdef HAVE_SYSTEMD_SD_JOURNAL_H
ce18aa
+  if (job && strcmp(ErrorLog, "syslog"))
ce18aa
+#else
ce18aa
   if (job)
ce18aa
+#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
ce18aa
     snprintf(jobmsg, sizeof(jobmsg), "[Job %d] %s", job->id, message);
ce18aa
   else
ce18aa
     strlcpy(jobmsg, message, sizeof(jobmsg));
ce18aa
@@ -673,7 +632,43 @@ cupsdLogJob(cupsd_job_t *job,		/* I - Job */
370473
       return (1);
370473
     }
370473
     else if (level <= LogLevel)
370473
+    {
370473
+#ifdef HAVE_SYSTEMD_SD_JOURNAL_H
370473
+      if (!strcmp(ErrorLog, "syslog"))
370473
+      {
ce18aa
+	cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest) : NULL)) : NULL;
ce18aa
+	static const char * const job_states[] =
ce18aa
+	{					/* job-state strings */
ce18aa
+	  "Pending",
ce18aa
+	  "PendingHeld",
ce18aa
+	  "Processing",
ce18aa
+	  "ProcessingStopped",
ce18aa
+	  "Canceled",
ce18aa
+	  "Aborted",
ce18aa
+	  "Completed"
ce18aa
+	};
ce18aa
+
ce18aa
+	if (job)
ce18aa
+	  sd_journal_send("MESSAGE=%s", log_line,
ce18aa
+			  "PRIORITY=%i", log_levels[level],
ce18aa
+			  PWG_Event"=JobStateChanged",
ce18aa
+			  PWG_ServiceURI"=%s", printer ? printer->uri : "",
ce18aa
+			  PWG_JobID"=%d", job->id,
ce18aa
+			  PWG_JobState"=%s", job->state_value < IPP_JSTATE_PENDING ? "" : job_states[job->state_value - IPP_JSTATE_PENDING],
ce18aa
+			  PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0),
ce18aa
+			  NULL);
ce18aa
+	else
ce18aa
+	  sd_journal_send("MESSAGE=%s", log_line,
ce18aa
+			  "PRIORITY=%i", log_levels[level],
ce18aa
+			  NULL);
ce18aa
+
ce18aa
+	return (1);
370473
+      }
ce18aa
+      else
370473
+#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
ce18aa
+
370473
       return (cupsdWriteErrorLog(level, log_line));
370473
+    }
370473
     else
370473
       return (1);
370473
   }