Beispiel #1
0
        /// <summary>
        /// Prevents a default instance of the <see cref="JsonPacket"/> class from being created.
        /// </summary>
        private JsonPacket()
        {
            // Get assemblies.
            Modules = SystemUtil.GetModules();

            // The current hostname
            ServerName = System.Environment.MachineName;

            // Create timestamp
            TimeStamp = DateTime.UtcNow;

            // Default logger.
            Logger = "root";

            // Default error level.
            Level = ErrorLevel.Error;

            // Create a guid.
            EventID = Guid.NewGuid().ToString("n");

            // Project
            Project = "default";

            // Platform
            Platform = "csharp";

            // Release
            Release = "";

            // Environment
            Environment = "";
        }
        /// <summary>
        /// Prevents a default instance of the <see cref="JsonPacket"/> class from being created.
        /// </summary>
        private JsonPacket()
        {
            // Get assemblies.
            Modules = SystemUtil.GetModules();

            // The current hostname
            ServerName = Environment.MachineName;

            // Create timestamp
            TimeStamp = DateTime.UtcNow;

            // Default logger.
            Logger = "root";

            // Default error level.
            Level = ErrorLevel.Error;

            // Create a guid.
            EventID = Guid.NewGuid().ToString("n");

            // Project
            Project = "default";

            // Platform
            Platform = "csharp";

            // Get data from the HTTP request
            Request = SentryRequest.GetRequest();

            // Get the user data from the HTTP context or environment
            User = Request != null
                       ? Request.GetUser()
                       : new SentryUser(Environment.UserName);
        }