-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Orchard.Logging module adding NLog to pipeline
- Loading branch information
Showing
9 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Name: Logging | ||
AntiForgery: enabled | ||
Author: The Orchard Team | ||
Website: http://orchardproject.net | ||
Version: 2.0.x | ||
OrchardVersion: 2.0 | ||
Description: Adds extra logging framework services. | ||
FeatureDescription: Configurable logging sevice trough NLog.config file. | ||
Dependencies: | ||
Category: Logging |
21 changes: 21 additions & 0 deletions
21
src/Orchard.Cms.Web/Modules/Orchard.Logging/Orchard.Logging.xproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>7e83c764-c822-4b8c-a690-e529cc9a1739</ProjectGuid> | ||
<RootNamespace>Orchard.Logging</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
19 changes: 19 additions & 0 deletions
19
src/Orchard.Cms.Web/Modules/Orchard.Logging/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Orchard.Logging")] | ||
[assembly: AssemblyTrademark("")] | ||
|
||
// 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("7e83c764-c822-4b8c-a690-e529cc9a1739")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Mvc.Modules; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using NLog.Extensions.Logging; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Orchard.Users | ||
{ | ||
public class Startup : StartupBase | ||
{ | ||
private readonly ILoggerFactory _loggerFactory; | ||
|
||
public Startup(ILoggerFactory loggerFactory) | ||
{ | ||
_loggerFactory = loggerFactory; | ||
} | ||
|
||
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider) | ||
{ | ||
_loggerFactory.AddNLog(); | ||
} | ||
|
||
public override void ConfigureServices(IServiceCollection services) | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"dependencies": { | ||
"Microsoft.Extensions.DependencyInjection": "1.0.0", | ||
"Microsoft.AspNetCore.Identity": "1.0.0", | ||
"NLog.Extensions.Logging": "1.0.0-*", | ||
"Microsoft.AspNetCore.Routing": "1.0.0", | ||
"Microsoft.AspNetCore.Mvc.Modules.Abstractions": "1.0.0-*" | ||
}, | ||
"buildOptions": { | ||
"debugType": "portable" | ||
}, | ||
"frameworks": { | ||
"netstandard1.6": { | ||
"imports": [ | ||
"dnxcore50", | ||
"portable-net451+win8" | ||
], | ||
"dependencies": { | ||
"NETStandard.Library": "1.6.0-*" | ||
} | ||
} | ||
}, | ||
"tools": { | ||
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
autoReload="true" | ||
internalLogLevel="Warn" | ||
internalLogFile="App_Data\Logs\internal-nlog.txt"> | ||
|
||
<!-- define various log targets --> | ||
<targets> | ||
<!-- write logs to file --> | ||
<target xsi:type="File" name="allfile" fileName="App_Data\Logs\orchard-log-${shortdate}.log" | ||
layout="${longdate}|${event-properties:item=EventId.Id}|${logger}|${uppercase:${level}}|${message} ${exception}" /> | ||
|
||
<!--<target xsi:type="Null" name="blackhole" /> --> | ||
</targets> | ||
|
||
<rules> | ||
<!--All logs--> | ||
<logger name="*" minlevel="Warn" writeTo="allfile" /> | ||
</rules> | ||
</nlog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters