forked from MarcelRaschke/PostSharp.Samples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
29 lines (24 loc) · 988 Bytes
/
Program.cs
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
using PostSharp.Patterns.Diagnostics;
using PostSharp.Samples.Logging.BusinessLogic;
using ServiceStack.Logging;
// Add logging to all methods of this project.
[assembly: Log(AttributePriority = 0)]
// Exclude logging from the PostSharp.Samples.Logging.CustomBackend.ServiceStack namespace.
[assembly:
Log(AttributePriority = 1, AttributeExclude = true,
AttributeTargetTypes = "PostSharp.Samples.Logging.CustomBackend.ServiceStack.*")]
namespace PostSharp.Samples.Logging.CustomBackend.ServiceStack
{
internal class Program
{
private static void Main(string[] args)
{
// Configure PostSharp Logging to use ServiceStack.
LoggingServices.DefaultBackend = new ServiceStackLoggingBackend();
// Configure ServiceStack to output logs to the console.
LogManager.LogFactory = new ConsoleLogFactory();
// Simulate some business logic.
QueueProcessor.ProcessQueue(@".\Private$\SyncRequestQueue");
}
}
}