internal static void SafeSetProp(this PropertiesDictionary props, string propKey, Func <string> valueGetter) { try { props.Set(propKey, valueGetter()); } catch (Exception ex) { props.Set(propKey, String.Format("Failed setting {0} key in logger because {1}", propKey, ex.Message)); } }
public ILoggingEventPropertiesBuilder WithMachineName() { _props.Set("MachineName", Environment.MachineName); return(this); }