Skip to content

Commit 0f309f2

Browse files
authored
Merge pull request #20 from vtex/feature/vtex_splunklogger_library
Create and released VTEXSplunkLogger library Cleaned sample WebApi project
2 parents cad90a5 + e978cea commit 0f309f2

13 files changed

+53
-22
lines changed

src/SampleWebAPI/Controllers/ValuesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.AspNetCore.Mvc;
44
using Microsoft.Extensions.Logging;
55

6-
namespace VTEX.SampleWebAPI.Controllers
6+
namespace Vtex.SampleWebAPI.Controllers
77
{
88
[Route("api/[controller]")]
99
public class ValuesController : Controller

src/SampleWebAPI/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.AspNetCore;
22
using Microsoft.AspNetCore.Hosting;
33

4-
namespace VTEX.SampleWebAPI
4+
namespace Vtex.SampleWebAPI
55
{
66
public class Program
77
{

src/SampleWebAPI/SampleWebAPI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<ReleaseVersion>1.0.1</ReleaseVersion>
66
<Description>Sample Web API project created to show how to use SplunkLogger library</Description>
7-
<RootNamespace>VTEX.SampleWebAPI</RootNamespace>
7+
<RootNamespace>Vtex.SampleWebAPI</RootNamespace>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<Folder Include="wwwroot\" />
12-
<Folder Include="Logging\" />
1312
</ItemGroup>
1413

1514
<ItemGroup>
@@ -22,5 +21,6 @@
2221

2322
<ItemGroup>
2423
<ProjectReference Include="..\SplunkLogger\SplunkLogger.csproj" />
24+
<ProjectReference Include="..\VTEXSplunkLogger\VTEXSplunkLogger.csproj" />
2525
</ItemGroup>
2626
</Project>

src/SampleWebAPI/Startup.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
using System;
2-
using System.Net.Http;
3-
using System.Threading;
4-
using Microsoft.AspNetCore.Builder;
1+
using Microsoft.AspNetCore.Builder;
52
using Microsoft.AspNetCore.Hosting;
63
using Microsoft.Extensions.Configuration;
74
using Microsoft.Extensions.DependencyInjection;
85
using Microsoft.Extensions.Logging;
96
using Splunk;
107
using Splunk.Configurations;
11-
using VTEX.SampleWebAPI.Logging;
8+
using Vtex.SplunkLogger;
129

13-
namespace VTEX.SampleWebAPI
10+
namespace Vtex.SampleWebAPI
1411
{
1512
public class Startup
1613
{
@@ -74,7 +71,5 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
7471

7572
app.UseMvc();
7673
}
77-
78-
7974
}
8075
}

src/SplunkLogger.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SplunkLogger", "SplunkLogge
55
EndProject
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWebAPI", "SampleWebAPI\SampleWebAPI.csproj", "{8D6EF394-5E88-4D15-97C0-FF2860DF53F3}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VTEXSplunkLogger", "VTEXSplunkLogger\VTEXSplunkLogger.csproj", "{4C4CFC3E-D748-4A81-ADC9-55B4F0ED1C69}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -19,6 +21,10 @@ Global
1921
{8D6EF394-5E88-4D15-97C0-FF2860DF53F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
2022
{8D6EF394-5E88-4D15-97C0-FF2860DF53F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
2123
{8D6EF394-5E88-4D15-97C0-FF2860DF53F3}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{4C4CFC3E-D748-4A81-ADC9-55B4F0ED1C69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{4C4CFC3E-D748-4A81-ADC9-55B4F0ED1C69}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{4C4CFC3E-D748-4A81-ADC9-55B4F0ED1C69}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{4C4CFC3E-D748-4A81-ADC9-55B4F0ED1C69}.Release|Any CPU.Build.0 = Release|Any CPU
2228
EndGlobalSection
2329
GlobalSection(MonoDevelopProperties) = preSolution
2430
description = C# .Net Core 2 Splunk ILogger Compatible Implementation

src/SplunkLogger/SplunkLogger.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.0</TargetFramework>
5-
<ReleaseVersion>1.0.1</ReleaseVersion>
5+
<ReleaseVersion>1.0.1</ReleaseVersion>
66
<Version>1.0.1</Version>
77
<Description>Splunk .Net Core ILogger Compatible Library</Description>
88
<RootNamespace>Splunk</RootNamespace>

src/SampleWebAPI/Logging/VTEXSplunkEntryExtensions.cs renamed to src/VTEXSplunkLogger/ILoggerExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using System;
22
using Microsoft.Extensions.Logging;
3-
using VTEX.SampleWebAPI.Logging;
3+
using Vtex.SplunkLogger;
44

5-
namespace VTEX.SampleWebAPI
5+
namespace Vtex
66
{
77
/// <summary>
88
/// This class contains ILogger extension method to simplify the process to record a VTEX log.
99
/// </summary>
10-
public static class VTEXSplunkEntryExtensions
10+
public static class ILoggerExtensions
1111
{
1212
static readonly EventId EmptyEventId = new EventId();
1313

src/SampleWebAPI/Logging/LoggerFactoryExtensions.cs renamed to src/VTEXSplunkLogger/LoggerFactoryExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using Splunk.Configurations;
44
using Splunk;
55

6-
namespace VTEX.SampleWebAPI
6+
namespace Vtex.SplunkLogger
77
{
88
/// <summary>
9-
///
9+
/// This class contains ILoggerFactory extension method to simplify the process to add a Splunk logger provider.
1010
/// </summary>
1111
public static class LoggerFactoryExtensions
1212
{

src/SampleWebAPI/Logging/VTEXEventLevel.cs renamed to src/VTEXSplunkLogger/VTEXEventLevel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
namespace VTEX.SampleWebAPI.Logging
2+
namespace Vtex.SplunkLogger
33
{
44
/// <summary>
55
/// This enumeration represents the log event levels defined at VTEX.

src/SampleWebAPI/Logging/VTEXLogType.cs renamed to src/VTEXSplunkLogger/VTEXLogType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
namespace VTEX.SampleWebAPI.Logging
2+
namespace Vtex.SplunkLogger
33
{
44
/// <summary>
55
/// This enumeration represents the log types defined at VTEX.

0 commit comments

Comments
 (0)