forked from stackify/stackify-api-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
45 lines (38 loc) · 1.33 KB
/
Copy pathProgram.cs
File metadata and controls
45 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StackifyLib;
namespace ConsoleTest
{
class Program
{
static log4net.ILog log = log4net.LogManager.GetLogger(typeof(Program));
static void Main(string[] args)
{
log4net.Config.XmlConfigurator.Configure();
StackifyLib.Utils.StackifyAPILogger.LogEnabled = true;
for (int i = 0; i < 1000; i++)
{
var ex = new ApplicationException("Test error");
Logger.QueueException(ex);
Logger.Queue("DEBUG", "test " + i);
//log.Info("test info " + i);
//log.Info("object test" + i, new { First = 1, Second = 2, OK = true, DT = DateTime.UtcNow });
//log.Info(new { OjectOnly = true, DT = DateTime.UtcNow, Child = new { First = 1, Second = 2, OK = true, DT = DateTime.UtcNow } });
//log.Debug("test debug " + i);
//log.Fatal("test fatal " + i);
//log.Error("test error " + i);
//log.Error("test error object" + i, ex);
System.Threading.Thread.Sleep(2000);
}
Debug.WriteLine("Closing app...");
}
static void StackifyAPILogger_OnLogMessage(string data)
{
Debug.WriteLine(data);
}
}
}