Skip to content

Commit

Permalink
Add _CommonAssemblyInfo.cs_ to the new Azure DocumentDB sink, and fix…
Browse files Browse the repository at this point in the history
… some capitalisation conventions while there (https://msdn.microsoft.com/en-us/library/vstudio/ms229043%28v=vs.100%29.aspx)

The caps change is a breaking one but since the sink is brand new, better to get it in now.
  • Loading branch information
nblumhardt committed Feb 1, 2015
1 parent 1afb9fb commit 9532db2
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Serilog.sln
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.MonoAndroid",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.MonoTouch", "src\Serilog.Sinks.MonoTouch\Serilog.Sinks.MonoTouch.csproj", "{7E96D14B-2224-4EB9-B26B-6306D225024F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.AzureDocumentDb", "src\Serilog.Sinks.AzureDocumentDb\Serilog.Sinks.AzureDocumentDb.csproj", "{C1875BEA-4509-4E04-AB8F-C2F8169BF001}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.AzureDocumentDB", "src\Serilog.Sinks.AzureDocumentDb\Serilog.Sinks.AzureDocumentDB.csproj", "{C1875BEA-4509-4E04-AB8F-C2F8169BF001}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.MsTests", "test\Serilog.MsTests\Serilog.MsTests.csproj", "{7FC9FC46-5014-4461-A448-815E6CCE21E5}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Serilog
/// <summary>
/// Adds the WriteTo.AzureDocumentDb() extension method to <see cref="LoggerConfiguration"/>.
/// </summary>
public static class LoggerConfigurationAzureDocumentDbExtensions
public static class LoggerConfigurationAzureDocumentDBExtensions
{
/// <summary>
/// Adds a sink that writes log events to a Azure DocumentDB table in the provided endpoint.
Expand All @@ -35,7 +35,7 @@ public static class LoggerConfigurationAzureDocumentDbExtensions
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
/// <exception cref="ArgumentNullException">A required parameter is null.</exception>
public static LoggerConfiguration AzureDocumentDb(
public static LoggerConfiguration AzureDocumentDB(
this LoggerSinkConfiguration loggerConfiguration,
Uri endpointUri,
string authorizationKey,
Expand All @@ -48,7 +48,7 @@ public static class LoggerConfigurationAzureDocumentDbExtensions
if (endpointUri == null) throw new ArgumentNullException("endpointUri");
if (authorizationKey == null) throw new ArgumentNullException("authorizationKey");
return loggerConfiguration.Sink(
new AzureDocumentDbSink(endpointUri, authorizationKey, databaseName, collectionName, formatProvider),
new AzureDocumentDBSink(endpointUri, authorizationKey, databaseName, collectionName, formatProvider),
restrictedToMinimumLevel);
}
}
Expand Down
40 changes: 8 additions & 32 deletions src/Serilog.Sinks.AzureDocumentDb/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Serilog.Sinks.AzureDocumentDb")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Serilog.Sinks.AzureDocumentDb")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyTitle("Serilog.Sinks.AzureDocumentDB")]
[assembly: AssemblyDescription("Write Serilog events to Azure DocumentDB")]
[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2013-2015")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5c4f5dff-961d-4e1c-beab-e9aa9bbed76b")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" +
"6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" +
"d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" +
"94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" +
"b19485ec")]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Serilog</RootNamespace>
<AssemblyName>Serilog.Sinks.AzureDocumentDb</AssemblyName>
<AssemblyName>Serilog.Sinks.AzureDocumentDB</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
Expand Down Expand Up @@ -51,18 +51,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LoggerConfigurationAzureDocumentDbExtensions.cs" />
<Compile Include="..\..\assets\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="LoggerConfigurationAzureDocumentDBExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Sinks\AzureDocumentDb\AzureDocumentDbSink.cs" />
<Compile Include="Sinks\AzureDocumentDb\Data\LogEvent.cs" />
<Compile Include="Sinks\AzureDocumentDb\DocumentDbPropertyFormatter.cs" />
<Compile Include="Sinks\AzureDocumentDB\AzureDocumentDBSink.cs" />
<Compile Include="Sinks\AzureDocumentDB\Data\LogEvent.cs" />
<Compile Include="Sinks\AzureDocumentDB\DocumentDBPropertyFormatter.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\assets\Serilog.snk">
<Link>Serilog.snk</Link>
</None>
<None Include="packages.config" />
<None Include="Serilog.Sinks.AzureDocumentDb.nuspec">
<None Include="Serilog.Sinks.AzureDocumentDB.nuspec">
<SubType>Designer</SubType>
</None>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Serilog.Sinks.AzureDocumentDb</id>
<id>Serilog.Sinks.AzureDocumentDB</id>
<version>$version$</version>
<authors>Robert Moore</authors>
<description>Serilog event sink that writes to Azure DocumentDB over HTTP.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

namespace Serilog.Sinks.AzureDocumentDb
{
public class AzureDocumentDbSink : ILogEventSink
public class AzureDocumentDBSink : ILogEventSink
{
readonly IFormatProvider _formatProvider;
DocumentClient _client;
Database _database;
DocumentCollection _collection;

public AzureDocumentDbSink(Uri endpointUri, string authorizationKey, string databaseName, string collectionName, IFormatProvider formatProvider)
public AzureDocumentDBSink(Uri endpointUri, string authorizationKey, string databaseName, string collectionName, IFormatProvider formatProvider)
{
_formatProvider = formatProvider;
_client = new DocumentClient(endpointUri, authorizationKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public LogEvent(Events.LogEvent logEvent, string renderedMessage)
Properties = new Dictionary<string, object>();
foreach (var pair in logEvent.Properties)
{
Properties.Add(pair.Key, DocumentDbPropertyFormatter.Simplify(pair.Value));
Properties.Add(pair.Key, DocumentDBPropertyFormatter.Simplify(pair.Value));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Serilog.Sinks.AzureDocumentDb
/// Converts <see cref="LogEventProperty"/> values into simple scalars,
/// dictionaries and lists so that they can be persisted in Azure DocumentDB.
/// </summary>
public static class DocumentDbPropertyFormatter
public static class DocumentDBPropertyFormatter
{
static readonly HashSet<Type> ScalarTypes = new HashSet<Type>
{
Expand Down

0 comments on commit 9532db2

Please sign in to comment.