From 068e4d8d2cbdf0a9c2547e98eff5e45a30bc161f Mon Sep 17 00:00:00 2001 From: Xharze Date: Sat, 31 Jan 2015 21:55:42 +0100 Subject: [PATCH 1/4] Create project and site name layout renderer --- NLog.Web.sln | 22 +++++++++ NLog.Web/IISInstanceNameLayoutRenderer.cs | 15 ++++++ NLog.Web/NLog.Web.csproj | 59 +++++++++++++++++++++++ NLog.Web/Properties/AssemblyInfo.cs | 36 ++++++++++++++ NLog.Web/packages.config | 4 ++ 5 files changed, 136 insertions(+) create mode 100644 NLog.Web.sln create mode 100644 NLog.Web/IISInstanceNameLayoutRenderer.cs create mode 100644 NLog.Web/NLog.Web.csproj create mode 100644 NLog.Web/Properties/AssemblyInfo.cs create mode 100644 NLog.Web/packages.config diff --git a/NLog.Web.sln b/NLog.Web.sln new file mode 100644 index 00000000..74b7efcf --- /dev/null +++ b/NLog.Web.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Web", "NLog.Web/NLog.Web.csproj", "{E30DC886-8431-4CFA-90FA-38D9BE4203A0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E30DC886-8431-4CFA-90FA-38D9BE4203A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E30DC886-8431-4CFA-90FA-38D9BE4203A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E30DC886-8431-4CFA-90FA-38D9BE4203A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E30DC886-8431-4CFA-90FA-38D9BE4203A0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/NLog.Web/IISInstanceNameLayoutRenderer.cs b/NLog.Web/IISInstanceNameLayoutRenderer.cs new file mode 100644 index 00000000..b9903d80 --- /dev/null +++ b/NLog.Web/IISInstanceNameLayoutRenderer.cs @@ -0,0 +1,15 @@ +using System.Text; +using System.Web.Hosting; +using NLog.LayoutRenderers; + +namespace NLog.Web +{ + [LayoutRenderer("iis-site-name")] + public class IISInstanceNameLayoutRenderer : LayoutRenderer + { + protected override void Append(StringBuilder builder, LogEventInfo logEvent) + { + builder.Append(HostingEnvironment.SiteName); + } + } +} diff --git a/NLog.Web/NLog.Web.csproj b/NLog.Web/NLog.Web.csproj new file mode 100644 index 00000000..1f87c780 --- /dev/null +++ b/NLog.Web/NLog.Web.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {E30DC886-8431-4CFA-90FA-38D9BE4203A0} + Library + Properties + NLog.Web + NLog.Web + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\NLog.3.2.0.0\lib\net35\NLog.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NLog.Web/Properties/AssemblyInfo.cs b/NLog.Web/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f6c61e1c --- /dev/null +++ b/NLog.Web/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("NLog.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("NLog.Web")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 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("76508ba5-3321-41a4-90b4-99958822f19b")] + +// 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")] diff --git a/NLog.Web/packages.config b/NLog.Web/packages.config new file mode 100644 index 00000000..dd08570d --- /dev/null +++ b/NLog.Web/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 848532b6aabe452b17308ae905f11920c9fe8c29 Mon Sep 17 00:00:00 2001 From: Xharze Date: Sat, 31 Jan 2015 21:57:16 +0100 Subject: [PATCH 2/4] Add appveyor.yml --- appveyor.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..9fdffe5f --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,18 @@ +version: 1.0.{build} +configuration: Release +platform: Any CPU +assembly_info: + patch: true + file: '**\AssemblyInfo.*' + assembly_version: '{version}' + assembly_file_version: '{version}' + assembly_informational_version: '{version}' +nuget: + project_feed: true +before_build: +- ps: nuget restore +build: + publish_nuget: true + publish_nuget_symbols: true + verbosity: normal +deploy: off \ No newline at end of file From 1ec6f049968d87b59e18471a7109710f76210c8d Mon Sep 17 00:00:00 2001 From: Xharze Date: Sat, 31 Jan 2015 22:03:20 +0100 Subject: [PATCH 3/4] Add nuspec file --- NLog.Web/NLog.Web.nuspec | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 NLog.Web/NLog.Web.nuspec diff --git a/NLog.Web/NLog.Web.nuspec b/NLog.Web/NLog.Web.nuspec new file mode 100644 index 00000000..c299d343 --- /dev/null +++ b/NLog.Web/NLog.Web.nuspec @@ -0,0 +1,17 @@ + + + + NLog.Web + $version$ + NLog.Web + NLog + NLog + https://github.com/NLog/NLog.Web/raw/master/LICENSE + https://github.com/NLog/NLog.Web + false + NLog targets and layout renderers specific for web site + Community contributed custom target for NLog. + Copyright 2014-2015 + nlog target layoutrenderer web + + \ No newline at end of file From 154c4a1c8f59ba04c474ac389073438a32778e75 Mon Sep 17 00:00:00 2001 From: Xharze Date: Sat, 31 Jan 2015 22:16:04 +0100 Subject: [PATCH 4/4] Do not publish packages on PRs --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 9fdffe5f..301ebd93 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,6 +9,7 @@ assembly_info: assembly_informational_version: '{version}' nuget: project_feed: true + disable_publish_on_pr: true before_build: - ps: nuget restore build: