ModelFactoryGenerateLogForException Method

Generates a log for an exception.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
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