Example #1
0
        /// <summary>
        /// Log job event
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="jobType"></param>
        /// <param name="executionType"></param>
        /// <param name="resultStatus"></param>
        /// <param name="message"></param>
        /// <param name="exception"></param>
        private static void LogJobEvent(LogLevel logLevel, JobTypeEnum jobType, JobExecutionTypeEnum executionType, JobResultStatusEnum resultStatus, string message, Exception exception = null)
        {
            var theEvent = new LogEventInfo(logLevel, JOB_LOGGER_NAME, message);

            theEvent.Properties["JobStatus"]     = resultStatus.ToString();
            theEvent.Properties["JobType"]       = jobType.ToString();
            theEvent.Properties["ExecutionType"] = executionType.ToString();
            if (exception != null)
            {
                theEvent.Exception = exception;
            }
            JobLogger.Log(theEvent);
        }