public IHttpActionResult Post(ReceiveFormUrlEncoded raw) { var logger = NLog.LogManager.GetLogger("Logmaster"); try { var record = JsonConvert.SerializeObject(raw); logger.Info(record); var director = new GenericRecordDirector(Detector.Logmaster, record, DeviceType.S, new LogmasterNotifierStrategy()); director.Execute(); return(Ok()); } catch (Exception ex) { throw ex; } }
public IHttpActionResult Post(ReceiveFormUrlEncoded raw) { var logger = NLog.LogManager.GetLogger("Cacti"); try { var record = JsonConvert.SerializeObject(raw); logger.Info(record); var director = new GenericRecordDirector(Detector.BobCacti, record, DeviceType.N, new GenericNotifierStrategy()); director.Execute(); return(Ok()); } catch (Exception ex) { logger.Error(ex); return(Content(HttpStatusCode.InternalServerError, ex)); } }