Exemplo n.º 1
0
        /// <summary>
        /// Create the best stub of a request that we can using the message level and body
        /// </summary>
        /// <param name="level"></param>
        /// <param name="body"></param>
        /// <returns></returns>
        protected DataModel Create(string level, BodyModel body)
        {
            var model = new DataModel(level, body);

            model.Environment = Configuration.Environment;
            model.Platform = Configuration.Platform;
            model.Language = Configuration.Language;
            model.Framework = Configuration.Framework;

            model.Timestamp = (ulong)Now();

            model.Notifier = NotifierModelBuilder.CreateFromAssemblyInfo();

            model.Request = RequestModelBuilder.CreateFromCurrentRequest(Configuration.ScrubParams);
            model.Server = ServerModelBuilder.CreateFromCurrentRequest();
            model.Server.GitSha = Configuration.GitSha;
            model.Person = PersonModelBuilder.CreateFromCurrentRequest();

            return model;
        }
Exemplo n.º 2
0
 public void Send(DataModel data, object userParam)
 {
     var payload = new PayloadModel(Configuration.AccessToken, data);
     HttpPost(payload, userParam);
 }
Exemplo n.º 3
0
 public PayloadModel(string accessToken, DataModel data)
 {
     AccessToken = accessToken;
     Data = data;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Create the best stub of a request that we can using the message level and body
        /// </summary>
        /// <param name="level"></param>
        /// <param name="body"></param>
        /// <returns></returns>
        protected DataModel Create(string level, BodyModel body, IDictionary<string, string> requestSession, PersonModel person)
        {
            var model = new DataModel(level, body);

            model.CodeVersion = Configuration.CodeVersion;
            model.Environment = Configuration.Environment;
            model.Platform = Configuration.Platform;
            model.Language = Configuration.Language;
            model.Framework = Configuration.Framework;

            model.Timestamp = (ulong)Now();

            model.Notifier = NotifierModelBuilder.CreateFromAssemblyInfo();

            var currentHttpRequest = GetCurrentHttpRequest();

            if (currentHttpRequest == null)
            {
                model.Request = new RequestModel();
                model.Server = new ServerModel();
                model.Person = new PersonModel();
            }
            else
            {
                model.Request = RequestModelBuilder.CreateFromHttpRequest(currentHttpRequest, HttpContext.Current.Session, Configuration.ScrubParams);
                model.Server = ServerModelBuilder.CreateFromHttpRequest(currentHttpRequest);
                model.Person = PersonModelBuilder.CreateFromHttpRequest(currentHttpRequest);
            }

            if (requestSession != null)
            {
                foreach(var key in requestSession.Keys)
                {
                    model.Request.Session[key] = requestSession[key];
                }
            }

            if (person != null)
            {
                model.Person.Email = person.Email ?? model.Person.Email;
                model.Person.Id = person.Id ?? model.Person.Id;
                model.Person.Username = person.Username ?? model.Person.Username;
            }

            model.Server.GitSha = Configuration.GitSha;

            return model;
        }
Exemplo n.º 5
0
 public void Send(DataModel data)
 {
     var payload = new PayloadModel(Configuration.AccessToken, data);
     HttpPost(payload);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Create the best stub of a request that we can using the message level and body
        /// </summary>
        /// <param name="level"></param>
        /// <param name="body"></param>
        /// <returns></returns>
        protected DataModel Create(string level, BodyModel body)
        {
            var model = new DataModel(level, body);

            model.CodeVersion = Configuration.CodeVersion;
            model.Environment = Configuration.Environment;
            model.Platform = Configuration.Platform;
            model.Language = Configuration.Language;
            model.Framework = Configuration.Framework;

            model.Timestamp = (ulong)Now();

            model.Notifier = NotifierModelBuilder.CreateFromAssemblyInfo();

            var currentHttpRequest = GetCurrentHttpRequest();

            if (currentHttpRequest == null)
            {
                model.Request = new RequestModel();
                model.Server = new ServerModel();
                model.Person = new PersonModel();
            }
            else
            {
                model.Request = RequestModelBuilder.CreateFromHttpRequest(currentHttpRequest, HttpContext.Current.Session, Configuration.ScrubParams);
                model.Server = ServerModelBuilder.CreateFromHttpRequest(currentHttpRequest);
                model.Person = PersonModelBuilder.CreateFromHttpRequest(currentHttpRequest);
            }

            model.Server.GitSha = Configuration.GitSha;

            return model;
        }