Skip to content

Commit 15746cf

Browse files
committed
Initial version.
1 parent d620130 commit 15746cf

18 files changed

+13357
-0
lines changed

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-rc1-update1"
5+
}
6+
}

sample/Sample/Program.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.Extensions.Configuration;
6+
using Serilog;
7+
8+
namespace Sample
9+
{
10+
public class Program
11+
{
12+
public static void Main(string[] args)
13+
{
14+
var configuration = new ConfigurationBuilder()
15+
.AddJsonFile("appsettings.json")
16+
.Build();
17+
18+
var logger = new LoggerConfiguration()
19+
.ReadFrom.Configuration(configuration)
20+
.CreateLogger();
21+
22+
logger.Information("Hello, world!");
23+
}
24+
}
25+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Sample")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Sample")]
13+
[assembly: AssemblyCopyright("Copyright © 2016")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("a00e5e32-54f9-401a-bba1-2f6fcb6366cd")]

sample/Sample/Sample.xproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>a00e5e32-54f9-401a-bba1-2f6fcb6366cd</ProjectGuid>
11+
<RootNamespace>Sample</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
14+
</PropertyGroup>
15+
16+
<PropertyGroup>
17+
<SchemaVersion>2.0</SchemaVersion>
18+
</PropertyGroup>
19+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
20+
</Project>

sample/Sample/appsettings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"Serilog": {
3+
"Using": ["Serilog.Sinks.Literate"],
4+
"MinimumLevel": "Debug",
5+
"WriteTo": [
6+
{ "Name": "LiterateConsole" },
7+
{ "Name": "File", "Args": { "path": "%TEMP%\\Logs\\serilog-configuration-sample.txt" } }
8+
],
9+
"Enrich": {
10+
"WithProperties": {
11+
"Application": "Sample"
12+
},
13+
"With": ["MachineName", "ThreadId", "ProcessId"]
14+
}
15+
}
16+
}

sample/Sample/project.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "1.0.0-*",
3+
"description": "Sample Console Application",
4+
"authors": [ "nblumhardt" ],
5+
"tags": [ "" ],
6+
"projectUrl": "",
7+
"licenseUrl": "",
8+
9+
"compilationOptions": {
10+
"emitEntryPoint": true
11+
},
12+
13+
"dependencies": {
14+
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
15+
"Serilog.Settings.Configuration": "",
16+
"Serilog.Sinks.Literate": "2.0.0-beta-21",
17+
"Serilog.Sinks.File": "2.0.0-beta-507",
18+
"Serilog.Enrichers.Environment": "2.0.0-beta-507",
19+
"Serilog.Enrichers.Process": "2.0.0-beta-507",
20+
"Serilog.Enrichers.Thread": "2.0.0-beta-507"
21+
},
22+
23+
"commands": {
24+
"Sample": "Sample"
25+
},
26+
27+
"frameworks": {
28+
"dnx451": { },
29+
"dnxcore50": {
30+
"dependencies": {
31+
"Microsoft.CSharp": "4.0.1-beta-23516",
32+
"System.Collections": "4.0.11-beta-23516",
33+
"System.Console": "4.0.0-beta-23516",
34+
"System.Linq": "4.0.1-beta-23516",
35+
"System.Threading": "4.0.11-beta-23516"
36+
}
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)