Skip to content

Commit 263dc46

Browse files
author
mwatson
committed
2 parents 793ee53 + d1fb064 commit 263dc46

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,21 @@ PM> Install-Package StackifyLib
197197

198198
If you use a custom logging framework or a framework not currently supported, you can easily send logs to Stackify with our core library and API like so:
199199

200-
StackifyLib.Logger.Queue("DEBUG", "My log message");
201-
StackifyLib.Logger.QueueException("Test exception", new ApplicationException("Sky is falling"));
202-
203-
StackifyLib.Logger.Shutdown(); //should be called before your app closes to flush the log queue
200+
StackifyLib.Logger.Queue("DEBUG", "My log message");
201+
StackifyLib.Logger.QueueException("Test exception", new ApplicationException("Sky is falling"));
202+
203+
StackifyLib.Logger.Shutdown(); //should be called before your app closes to flush the log queue
204+
205+
//More advanced example
206+
LogMsg msg = new LogMsg();
207+
msg.Ex = StackifyError.New(new ApplicationException("Exception goes here"));
208+
msg.AppDetails = new LogMsgGroup() {AppName = "My app", Env = "Prod", ServerName = Environment.MachineName};
209+
msg.data = StackifyLib.Utils.HelperFunctions.SerializeDebugData(new { color= "red"}, true);
210+
msg.Msg = "My log message";
211+
msg.Level = "ERROR";
212+
StackifyLib.Logger.QueueLogObject(msg);
213+
214+
*Make sure you call StackifyLib.Logger.Shutdown() before your app ends to flush the queue*
204215

205216
###Configuring with Azure service definitions
206217

0 commit comments

Comments
 (0)