Exemple #1
0
        private ErrorEventPacket RecombineEventPacket(ErrorDefinitionEntity errorDefinition, ErrorInstanceEntity errorInstance)
        {
            var inputLogEvent = new InputLogEvent();
            inputLogEvent.Message = errorDefinition.MessageSource;

            var errorEvent = new ErrorEventEntity();
            errorEvent.Application = errorDefinition.Application;
            errorEvent.ApplicationDateTime = errorInstance.ApplicationDateTime;
            errorEvent.Exceptions = RecombineExceptions(errorDefinition.Exceptions, errorInstance.Exceptions);
            errorEvent.Fingerprint = errorDefinition.Fingerprint;
            errorEvent.MessageSource = errorDefinition.MessageSource;
            errorEvent.Server = GetFromServerCache(errorInstance.ServerCacheId);

            var eventPacket = new ErrorEventPacket(inputLogEvent);
            eventPacket.ErrorEventEntity = errorEvent;

            return eventPacket;
        }
Exemple #2
0
 private void AddToDefinitions(ErrorDefinitionEntity errorDefinition)
 {
     _errorDefinitions.TryAdd(errorDefinition.Fingerprint.StringValue, errorDefinition);
 }
Exemple #3
0
        private Tuple<ErrorDefinitionEntity, ErrorInstanceEntity> SplitEventPacket(ErrorEventPacket eventPacket)
        {
            var errorDefinition = new ErrorDefinitionEntity();
            errorDefinition.Application = eventPacket.ErrorEventEntity.Application;
            errorDefinition.Exceptions = eventPacket.ErrorEventEntity.Exceptions.Select(x => new ExceptionDefinitionEntity()
            {
                Depth = x.Depth,
                ExceptionType = x.ExceptionType,
                StackFrames = x.StackFrames,
            }).ToList();
            errorDefinition.Fingerprint = eventPacket.ErrorEventEntity.Fingerprint;
            errorDefinition.MessageSource = eventPacket.ErrorEventEntity.MessageSource;

            var errorInstance = new ErrorInstanceEntity();
            errorInstance.ApplicationDateTime = eventPacket.ErrorEventEntity.ApplicationDateTime;
            errorInstance.FingerprintCacheId = AddToFingerprintCache(eventPacket.ErrorEventEntity.Fingerprint);
            errorInstance.ServerCacheId = AddToServerCache(eventPacket.ErrorEventEntity.Server);
            errorInstance.Exceptions = eventPacket.ErrorEventEntity.Exceptions.Select(x => new ExceptionInstanceEntity()
            {
                Depth = x.Depth,
                MessageCacheId = AddToMessageCache(x.Message)
            }).ToList();

            errorInstance.PersistenceAttempts = (short)eventPacket.PersistenceAttempts;

            return new Tuple<ErrorDefinitionEntity, ErrorInstanceEntity>(errorDefinition, errorInstance);
        }