Beispiel #1
0
        public static string FormatGeneralMessage(string methodName, string message)
        {
            var output = new FormatOutput()
            {
                MethodName = methodName,
                LogDate    = DateTime.Now,
                Message    = $"{methodName} {message}"
            };

            return(JsonConvert.SerializeObject(output));
        }
Beispiel #2
0
        public static string FormatExceptionMethodMessage(string methodName, Exception exception)
        {
            var output = new FormatOutput()
            {
                MethodName = methodName,
                LogDate    = DateTime.Now,
                Message    = $"Exception in:{methodName}:{exception.Message}:{exception.StackTrace}"
            };

            return(JsonConvert.SerializeObject(output));
        }