예제 #1
0
 public LogData(DateTime timestamp, IDictionary <string, object> fields)
 {
     Timestamp = timestamp;
     if (fields == null)
     {
         Fields = new LogField();
     }
     else if (fields is LogField logField)
     {
         Fields = logField;
     }
     else
     {
         Fields = new LogField(fields);
     }
 }
예제 #2
0
        public static ISpan Exception(this ISpan span, Exception exception)
        {
            if (span == null)
            {
                return(span);
            }

            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }

            span.Tags.Error(true);

            span.Log(LogField.CreateNew().EventError().ErrorKind(exception).Message(exception.Message));

            return(span);
        }
예제 #3
0
 public static ISpan Log(this ISpan span, LogField fields)
 {
     return(Log(span, DateTime.Now, fields));
 }
예제 #4
0
 public static LogField ServerReceive(this LogField logField)
 {
     return(logField?.Event("Server Receive"));
 }
예제 #5
0
 public static LogField ClientReceive(this LogField logField)
 {
     return(logField?.Event("Client Receive"));
 }
예제 #6
0
 public static LogField ServerSend(this LogField logField)
 {
     return(logField?.Event("Server Send"));
 }
예제 #7
0
 public static LogField ErrorKind <TException>(this LogField logField, TException exception) where TException : Exception
 {
     return(logField.ErrorKind(exception?.GetType()?.FullName));
 }
예제 #8
0
 public static LogField ClientSend(this LogField logField)
 {
     return(logField?.Event("Client Send"));
 }
예제 #9
0
 public static LogField ErrorObject(this LogField logField, Exception exception)
 {
     return(logField.Set(LogFields.ErrorObject, exception.Message));
 }
예제 #10
0
 public static LogField ErrorKind <TException>(this LogField logField) where TException : Exception
 {
     return(logField.ErrorKind(typeof(TException).FullName));
 }
예제 #11
0
 public static LogField ErrorKind(this LogField logField, string errorKind)
 {
     return(logField.Set(LogFields.ErrorKind, errorKind));
 }
예제 #12
0
 public static LogField Stack(this LogField logField, string stack)
 {
     return(logField.Set(LogFields.Stack, stack));
 }
예제 #13
0
 public static LogField Message(this LogField logField, string message)
 {
     return(logField.Set(LogFields.Message, message));
 }
예제 #14
0
 public static LogField EventError(this LogField logField)
 {
     return(logField.Set(LogFields.Event, LogFields.Error));
 }
예제 #15
0
 public static LogField Event(this LogField logField, string eventName)
 {
     return(logField.Set(LogFields.Event, eventName));
 }