Skip to content

Commit bb4306f

Browse files
committed
Adding sample
1 parent d5cdde1 commit bb4306f

4 files changed

Lines changed: 18 additions & 24 deletions

File tree

samples/LoggingReflectInsight/Console.ReflectInsightSample/Console.ReflectInsightSample.xproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>
16+
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
1617
</PropertyGroup>
17-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
18-
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
19-
</PropertyGroup>
18+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
2019
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
2120
</Project>
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//using AspNet.Plus.Logging.ReflectInsight;
2-
using Microsoft.Extensions.Configuration;
1+
using AspNet.Plus.Logging.ReflectInsight;
32
using Microsoft.Extensions.Logging;
43
using System;
54
using System.Collections.Generic;
@@ -10,22 +9,22 @@ namespace Console.ReflectInsightSample
109
{
1110
public class Program
1211
{
13-
private static LoggerFactory _factory;
14-
private static IConfigurationRoot _loggingConfiguration;
12+
private static LoggerFactory _factory;
1513

1614
public static void Main(string[] args)
17-
{
18-
_loggingConfiguration = new ConfigurationBuilder()
19-
//.AddXmlFile("ReflectInsight.config")
20-
.Build();
15+
{
16+
_factory = new LoggerFactory();
17+
_factory.MinimumLevel = LogLevel.Debug;
2118

22-
//_factory = new LoggerFactory();
23-
//_factory.AddReflectInsight();
19+
_factory.AddReflectInsight();
2420

25-
//var logger = _factory.CreateLogger<Program>();
21+
var logger = _factory.CreateLogger<Program>();
2622

27-
//logger.LogDebug("Debug");
28-
//logger.LogWarning("Warning");
23+
logger.LogDebug("Debug");
24+
logger.LogWarning("Warning");
25+
26+
System.Console.WriteLine("Pres any key to terminate...");
27+
System.Console.ReadKey();
2928
}
3029
}
3130
}

samples/LoggingReflectInsight/Console.ReflectInsightSample/ReflectInsight.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<enable state="all" />
77
<propagateException enabled="false" />
88
<exceptionEventTracker time="5" />
9-
<senderName name="WebApi.ReflectInsightSample" />
9+
<senderName name="Console.ReflectInsightSample" />
1010
</baseSettings>
1111

1212
<files default="Weekly">

samples/LoggingReflectInsight/Console.ReflectInsightSample/project.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
{
22
"version": "1.0.0-*",
33

4-
"dependencies": {
5-
"Microsoft.AspNet.FileProviders.Physical": "1.0.0-rc1-final",
6-
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final",
7-
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
8-
"Microsoft.Extensions.Configuration.Xml": "1.0.0-rc1-final",
9-
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
10-
"Microsoft.Extensions.Logging": "1.0.0-rc1-final"
4+
"dependencies": {
5+
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
6+
"AspNet.Plus.Logging.ReflectInsight": "1.0.0-*"
117
},
128

139
"commands": {

0 commit comments

Comments
 (0)