ModelFactoryGenerateLogForException Method

Generates a log for an exception.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
public static LogDto GenerateLogForException(
	EventId exceptionEvent,
	Exception exception
)

Parameters

exceptionEvent  EventId
The EventId related to the exception
exception  Exception
The exception itself

Return Value

LogDto
Generated LogDto for exception objects

Remarks

The irony of throwing an exception while logging an exception is not lost on me, but it's a necessary evil; if we cannot save the exception to the database, it will break the application, which is a lot worse.

Exceptions

ArgumentExceptionThrown if exceptionEvent is 0.
ArgumentNullExceptionThrown if exception is

See Also