Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Package NLog.Extensions 1.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package NLog.Extensions 1.0.1 supports: net45 (.NETFramework,Version=v4.5)
- NLog.NLogConfigurationException: Error when setting property 'Layout' on NLog.Targets.DatabaseParameterInfo ---> System.ArgumentException: LayoutRenderer cannot be found: 'aspnet-user-id'
- "NLog.Extensions.Logging": "1.0.0-rtm-alpha4",
- "NLog.Web.AspNetCore": "4.2.4" },
- "dependencies":{
- "Microsoft.NETCore.App":{
- "version":"1.0.1",
- "type":"platform"
- },
- "Microsoft.AspNetCore.Authentication.Cookies":"1.0.0-*",
- "Microsoft.AspNetCore.Diagnostics":"1.0.0-*",
- "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore":"1.0.0-*",
- "Microsoft.AspNetCore.Identity.EntityFrameworkCore":"1.0.0-*",
- "Microsoft.AspNetCore.Mvc":"1.0.0-*",
- "Microsoft.AspNetCore.Server.IISIntegration":"1.0.0-*",
- "Microsoft.AspNetCore.Server.Kestrel":"1.1.0-preview1-final",
- "Microsoft.AspNetCore.StaticFiles":"1.0.0-*",
- "Microsoft.EntityFrameworkCore.SqlServer":"1.1.0-preview1-final",
- "Microsoft.EntityFrameworkCore.Tools":"1.0.0-*",
- "Microsoft.Extensions.Configuration":"1.1.0-preview1-final",
- "Microsoft.Extensions.Configuration.EnvironmentVariables":"1.1.0-preview1-final",
- "Microsoft.Extensions.Options.ConfigurationExtensions":"1.0.0-*",
- "Microsoft.Extensions.Configuration.Json":"1.0.0-*",
- "Microsoft.Extensions.Configuration.UserSecrets":"1.0.0-*",
- "Microsoft.Extensions.Logging":"1.1.0-preview1-final",
- "Microsoft.Extensions.Logging.Console":"1.0.0-*",
- "Microsoft.Extensions.Logging.Debug":"1.0.0-*",
- "Microsoft.VisualStudio.Web.BrowserLink.Loader":"14.0.0-rc2-final",
- "Microsoft.VisualStudio.Web.CodeGenerators.Mvc":{
- "version":"1.0.0-*",
- "type":"build"
- },
- "RestSharp.NetCore":"105.2.3",
- "Dapper":"1.50.2",
- "NLog.Extensions.Logging":"1.0.0-rtm-alpha4",
- "NLog.Web.AspNetCore":"4.2.4"
- },
- "tools":{
- "Microsoft.AspNetCore.Razor.Tools":{
- "version":"1.0.0-*",
- "imports":"portable-net45+win8+dnxcore50"
- },
- "Microsoft.AspNetCore.Server.IISIntegration.Tools":{
- "version":"1.0.0-*",
- "imports":"portable-net45+win8+dnxcore50"
- },
- "Microsoft.EntityFrameworkCore.Tools":{
- "version":"1.0.0-*",
- "imports":[
- "portable-net45+win8+dnxcore50",
- "portable-net45+win8"
- ]
- },
- "Microsoft.Extensions.SecretManager.Tools":{
- "version":"1.0.0-*",
- "imports":"portable-net45+win8+dnxcore50"
- }
- },
- "frameworks":{
- "netcoreapp1.0":{
- "imports":[
- "dotnet5.6",
- "portable-net45+win8"
- ]
- }
- }
- <?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="C:tempLogsinternal-nlog.txt">
- <targets>
- <target xsi:type="Null" name="blackhole" />
- <target name="database" xsi:type="Database" >
- <connectionString>
- Server=localhost;Database=LogDatabase;Trusted_Connection=True;MultipleActiveResultSets=true
- </connectionString>
- <commandText>
- insert into dbo.Log (
- UserId, Application, LogDate, Level, Message, Exception
- ) values (
- @User, @Application, @Logged, @Level, @Message, @Exception
- );
- </commandText>
- <parameter name="@application" layout="WebApplicationNameHere" />
- <parameter name="@logged" layout="${date}" />
- <parameter name="@level" layout="${level}" />
- <parameter name="@message" layout="${message}" />
- <parameter name="@user" layout="${aspnet-user-id} " /> <!-- This is a custom attribute, set in NLogHelper.cs-->
- <parameter name="@exception" layout="${exception:tostring}" />
- </target>
- <!--<target name="email" xsi:type="Mail"
- subject="System Error"
- body="Date-Time:${newline}${longdate}${newline}${newline}Machine:${newline}${machinename}${newline}${newline}User:${newline}${aspnet-user-identity} ${newline}${newline}Message:${newline}${message}"
- to="first.last@domain.com"
- from="support@mg.domain.com"
- Encoding="UTF-8"
- smtpUsername="postmaster@mg.domain.com"
- enableSsl="true"
- smtpPassword="passwordgoeshere"
- smtpAuthentication="Basic"
- smtpServer="smtp.mailgun.org"
- smtpPort="587"
- /> -->
- </targets>
- <rules>
- <!--Skip Microsoft's verbose logging -->
- <logger name="Microsoft.*" minlevel="Trace" writeTo="blackhole" final="true" />
- <logger name="*" minlevel="Trace" writeTo="database" />
- <!--<logger name="*" level="Error" writeTo="email"/>-->
- </rules>
- <extensions>
- <!--enable NLog.Web for ASP.NET Core-->
- <add assembly="NLog.Web.AspNetCore"/>
- </extensions>
- </nlog>
- 2016-11-22 12:42:13.7563 Warn Error has been raised. Exception: NLog.NLogConfigurationException: Error when setting property 'Layout' on NLog.Targets.DatabaseParameterInfo ---> System.ArgumentException: LayoutRenderer cannot be found: 'aspnet-user-id'
- at NLog.Config.Factory`2.CreateInstance(String name)
- at NLog.Layouts.LayoutParser.ParseLayoutRenderer(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr)
- at NLog.Layouts.LayoutParser.CompileLayout(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr, Boolean isNested, String& text)
- at NLog.Layouts.SimpleLayout.set_Text(String value)
- at NLog.Internal.PropertyHelper.TryNLogSpecificConversion(Type propertyType, String value, Object& newValue, ConfigurationItemFactory configurationItemFactory)
- at NLog.Internal.PropertyHelper.SetPropertyFromString(Object obj, String propertyName, String value, ConfigurationItemFactory configurationItemFactory)
- --- End of inner exception stack trace ---
- at NLog.Internal.PropertyHelper.SetPropertyFromString(Object obj, String propertyName, String value, ConfigurationItemFactory configurationItemFactory)
- at NLog.Config.XmlLoggingConfiguration.ConfigureObjectFromAttributes(Object targetObject, NLogXmlElement element, Boolean ignoreType)
- at NLog.Config.XmlLoggingConfiguration.AddArrayItemFromElement(Object o, NLogXmlElement element)
- at NLog.Config.XmlLoggingConfiguration.SetPropertyFromElement(Object o, NLogXmlElement element)
- at NLog.Config.XmlLoggingConfiguration.ParseTargetElement(Target target, NLogXmlElement targetElement)
- at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement(NLogXmlElement targetsElement)
- at NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String filePath, Boolean autoReloadDefault)
- at NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors)
- <add assembly="NLog.Web.AspNetCore" />
Add Comment
Please, Sign In to add comment