Merge branch 'maint'
int log_service_event(service *svc) {
	char *temp_buffer = NULL;
	unsigned long log_options = 0L;
	host *temp_host = NULL;

	/* don't log soft errors if the user doesn't want to */
	if(svc->state_type == SOFT_STATE && !log_service_retries)
		return OK;

	/* get the log options */
	if(svc->current_state == STATE_UNKNOWN)
		log_options = NSLOG_SERVICE_UNKNOWN;
	else if(svc->current_state == STATE_WARNING)
		log_options = NSLOG_SERVICE_WARNING;
	else if(svc->current_state == STATE_CRITICAL)
		log_options = NSLOG_SERVICE_CRITICAL;
	else
		log_options = NSLOG_SERVICE_OK;

	/* find the associated host */
	if((temp_host = svc->host_ptr) == NULL)
		return ERROR;

	asprintf(&temp_buffer, "SERVICE ALERT: %s;%s;%s;%s;%d;%s\n",
			 svc->host_name, svc->description,
			 service_state_name(svc->current_state),
			 state_type_name(svc->state_type),
			 svc->current_attempt,
			 (svc->plugin_output == NULL) ? "" : svc->plugin_output);

	write_to_all_logs(temp_buffer, log_options);
	free(temp_buffer);

	return OK;
	}

int log_service_event(service *svc) {
	char *temp_buffer = NULL;
	unsigned long log_options = 0L;
	host *temp_host = NULL;

	/* don't log soft errors if the user doesn't want to */
	if(svc->state_type == SOFT_STATE && !log_service_retries)
		return OK;

	/* get the log options */
	if(svc->current_state == STATE_UNKNOWN)
		log_options = NSLOG_SERVICE_UNKNOWN;
	else if(svc->current_state == STATE_WARNING)
		log_options = NSLOG_SERVICE_WARNING;
	else if(svc->current_state == STATE_CRITICAL)
		log_options = NSLOG_SERVICE_CRITICAL;
	else
		log_options = NSLOG_SERVICE_OK;

	/* find the associated host */
	if((temp_host = svc->host_ptr) == NULL)
		return ERROR;

	asprintf(&temp_buffer, "SERVICE ALERT: %s;%s;%s;%s;%d;%s\n",
			 svc->host_name, svc->description,
			 service_state_name(svc->current_state),
			 state_type_name(svc->state_type),
			 svc->current_attempt,
			 (svc->plugin_output == NULL) ? "" : svc->plugin_output);

	write_to_all_logs(temp_buffer, log_options);
	free(temp_buffer);

	return OK;
	}
