Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample app #1

Merged
merged 3 commits into from Oct 11, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

This file was deleted.

@@ -1,2 +1 @@
# log4net-sample
Sample app to test log4net appender
# sources-sample-app
@@ -0,0 +1,35 @@
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
nupkg/
packages/

# Visual Studio Code
.vscode

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
msbuild.log
msbuild.err
msbuild.wrn

# Visual Studio 2015
.vs/
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcludeFieldsNETSerilog", "ExcludeFieldsNETSerilog\ExcludeFieldsNETSerilog.csproj", "{3B4DEF1C-C5D4-4BAC-95F8-2BCA31087D25}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B4DEF1C-C5D4-4BAC-95F8-2BCA31087D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B4DEF1C-C5D4-4BAC-95F8-2BCA31087D25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B4DEF1C-C5D4-4BAC-95F8-2BCA31087D25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B4DEF1C-C5D4-4BAC-95F8-2BCA31087D25}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E7140C5A-C07E-4056-8184-E9A323392DC7}
EndGlobalSection
EndGlobal
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="loggly" type="Loggly.Config.LogglyAppConfig, Loggly.Config"/>
</configSections>
<loggly
xmlns="Loggly"
applicationName="ExcludeFieldsSerilog"
customerToken="CUSTOMER_TOKEN"
isEnabled="true"
throwExceptions="true">

<transport logTransport="Https" endpointHostname="logs-01.loggly.com" endpointPort="443"/>

<!--<search account="your_loggly_account" username="a_loggly_username" password="myLittleP0ny!"/>-->

<tags>
<simple>
<tag value="Serilog-FieldExclude"/>
</simple>
<!--<complex>
<tag type="Loggly.HostnameTag" formatter="host-{0}"/>
<tag type="Loggly.ApplicationNameTag" formatter="application-{0}"/>
<tag type="Loggly.OperatingSystemVersionTag" formatter="os-{0}"/>
<tag type="Loggly.OperatingSystemPlatformTag" formatter="platform-{0}"/>
</complex>-->
</tags>
</loggly>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,24 @@
using Newtonsoft.Json.Linq;
using System.Collections.Generic;

namespace ExcludeFieldsNETSerilog
{
class ExcludeFields
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int EmployeeID { get; set; }
public string Designation { get; set; }
public string Address { get; set; }

public string excludeFields(string jsonString, List<string> discardedFields)
{
JObject jo = JObject.Parse(jsonString);
foreach (var discardedField in discardedFields)
{
jo.Remove(discardedField);
}
return jo.ToString(Newtonsoft.Json.Formatting.None);
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.