static async Task Main(string[] args) { string ip = "localhost"; if (args.Length >= 2) { ip = args[1]; } var p = new AnalogyMessageProducer($"http://{ip}:6000"); var ai = new Dictionary <string, string> { { "some key", "some value" } }; for (int i = 0; i < 100000; i++) { await p.Log(text : $@"test {i} ({CurrentFrameworkAttribute.FrameworkName})", source : "none", additionalInformation : ai, level : AnalogyLogLevel.Information).ConfigureAwait(false); await Task.Delay(500).ConfigureAwait(false); } }
private async void btnProducer_Click(object sender, EventArgs e) { if (producing) { return; } producing = true; btnProducer.Enabled = false; var p = new AnalogyMessageProducer($"http://{txtIP.Text}", null); var ai = new Dictionary <string, string> { { "some key", "some value" } }; for (int i = 0; i < 100000; i++) { await p.Log(text : "test " + i, source : "none", additionalInformation : ai, level : AnalogyLogLevel.Information).ConfigureAwait(false); await Task.Delay(500).ConfigureAwait(false); } producing = false; btnProducer.Enabled = true; }
public AnalogyLogServerSink(IFormatProvider formatProvider) { _formatProvider = formatProvider; logServerMessageProducer = new AnalogyMessageProducer("http://localhost:6000", null); }
/// <summary> /// /// </summary> /// <param name="formatProvider"></param> /// <param name="address"></param> public AnalogyLogServerSink(IFormatProvider formatProvider, string address) { _formatProvider = formatProvider; logServerMessageProducer = new AnalogyMessageProducer(address); }