Guest User

Untitled

a guest
Oct 24th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.62 KB | None | 0 0
  1. 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)
  2.  
  3. NLog.NLogConfigurationException: Error when setting property 'Layout' on NLog.Targets.DatabaseParameterInfo ---> System.ArgumentException: LayoutRenderer cannot be found: 'aspnet-user-id'
  4.  
  5. "NLog.Extensions.Logging": "1.0.0-rtm-alpha4",
  6. "NLog.Web.AspNetCore": "4.2.4" },
  7.  
  8. "dependencies":{
  9. "Microsoft.NETCore.App":{
  10. "version":"1.0.1",
  11. "type":"platform"
  12. },
  13. "Microsoft.AspNetCore.Authentication.Cookies":"1.0.0-*",
  14. "Microsoft.AspNetCore.Diagnostics":"1.0.0-*",
  15. "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore":"1.0.0-*",
  16. "Microsoft.AspNetCore.Identity.EntityFrameworkCore":"1.0.0-*",
  17. "Microsoft.AspNetCore.Mvc":"1.0.0-*",
  18. "Microsoft.AspNetCore.Server.IISIntegration":"1.0.0-*",
  19. "Microsoft.AspNetCore.Server.Kestrel":"1.1.0-preview1-final",
  20. "Microsoft.AspNetCore.StaticFiles":"1.0.0-*",
  21. "Microsoft.EntityFrameworkCore.SqlServer":"1.1.0-preview1-final",
  22. "Microsoft.EntityFrameworkCore.Tools":"1.0.0-*",
  23. "Microsoft.Extensions.Configuration":"1.1.0-preview1-final",
  24. "Microsoft.Extensions.Configuration.EnvironmentVariables":"1.1.0-preview1-final",
  25. "Microsoft.Extensions.Options.ConfigurationExtensions":"1.0.0-*",
  26. "Microsoft.Extensions.Configuration.Json":"1.0.0-*",
  27. "Microsoft.Extensions.Configuration.UserSecrets":"1.0.0-*",
  28. "Microsoft.Extensions.Logging":"1.1.0-preview1-final",
  29. "Microsoft.Extensions.Logging.Console":"1.0.0-*",
  30. "Microsoft.Extensions.Logging.Debug":"1.0.0-*",
  31. "Microsoft.VisualStudio.Web.BrowserLink.Loader":"14.0.0-rc2-final",
  32. "Microsoft.VisualStudio.Web.CodeGenerators.Mvc":{
  33. "version":"1.0.0-*",
  34. "type":"build"
  35. },
  36. "RestSharp.NetCore":"105.2.3",
  37. "Dapper":"1.50.2",
  38. "NLog.Extensions.Logging":"1.0.0-rtm-alpha4",
  39. "NLog.Web.AspNetCore":"4.2.4"
  40. },
  41. "tools":{
  42. "Microsoft.AspNetCore.Razor.Tools":{
  43. "version":"1.0.0-*",
  44. "imports":"portable-net45+win8+dnxcore50"
  45. },
  46. "Microsoft.AspNetCore.Server.IISIntegration.Tools":{
  47. "version":"1.0.0-*",
  48. "imports":"portable-net45+win8+dnxcore50"
  49. },
  50. "Microsoft.EntityFrameworkCore.Tools":{
  51. "version":"1.0.0-*",
  52. "imports":[
  53. "portable-net45+win8+dnxcore50",
  54. "portable-net45+win8"
  55. ]
  56. },
  57. "Microsoft.Extensions.SecretManager.Tools":{
  58. "version":"1.0.0-*",
  59. "imports":"portable-net45+win8+dnxcore50"
  60. }
  61. },
  62. "frameworks":{
  63. "netcoreapp1.0":{
  64. "imports":[
  65. "dotnet5.6",
  66. "portable-net45+win8"
  67. ]
  68. }
  69. }
  70.  
  71. <?xml version="1.0" encoding="utf-8" ?>
  72. <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
  73. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  74. autoReload="true"
  75. internalLogLevel="Warn"
  76. internalLogFile="C:tempLogsinternal-nlog.txt">
  77.  
  78. <targets>
  79. <target xsi:type="Null" name="blackhole" />
  80. <target name="database" xsi:type="Database" >
  81.  
  82. <connectionString>
  83. Server=localhost;Database=LogDatabase;Trusted_Connection=True;MultipleActiveResultSets=true
  84. </connectionString>
  85.  
  86. <commandText>
  87. insert into dbo.Log (
  88. UserId, Application, LogDate, Level, Message, Exception
  89. ) values (
  90. @User, @Application, @Logged, @Level, @Message, @Exception
  91. );
  92. </commandText>
  93.  
  94. <parameter name="@application" layout="WebApplicationNameHere" />
  95. <parameter name="@logged" layout="${date}" />
  96. <parameter name="@level" layout="${level}" />
  97. <parameter name="@message" layout="${message}" />
  98. <parameter name="@user" layout="${aspnet-user-id} " /> <!-- This is a custom attribute, set in NLogHelper.cs-->
  99. <parameter name="@exception" layout="${exception:tostring}" />
  100. </target>
  101.  
  102. <!--<target name="email" xsi:type="Mail"
  103. subject="System Error"
  104. body="Date-Time:${newline}${longdate}${newline}${newline}Machine:${newline}${machinename}${newline}${newline}User:${newline}${aspnet-user-identity} ${newline}${newline}Message:${newline}${message}"
  105. to="first.last@domain.com"
  106. from="support@mg.domain.com"
  107. Encoding="UTF-8"
  108. smtpUsername="postmaster@mg.domain.com"
  109. enableSsl="true"
  110. smtpPassword="passwordgoeshere"
  111. smtpAuthentication="Basic"
  112. smtpServer="smtp.mailgun.org"
  113. smtpPort="587"
  114. /> -->
  115. </targets>
  116. <rules>
  117. <!--Skip Microsoft's verbose logging -->
  118. <logger name="Microsoft.*" minlevel="Trace" writeTo="blackhole" final="true" />
  119. <logger name="*" minlevel="Trace" writeTo="database" />
  120. <!--<logger name="*" level="Error" writeTo="email"/>-->
  121. </rules>
  122. <extensions>
  123. <!--enable NLog.Web for ASP.NET Core-->
  124. <add assembly="NLog.Web.AspNetCore"/>
  125. </extensions>
  126. </nlog>
  127.  
  128. 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'
  129. at NLog.Config.Factory`2.CreateInstance(String name)
  130. at NLog.Layouts.LayoutParser.ParseLayoutRenderer(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr)
  131. at NLog.Layouts.LayoutParser.CompileLayout(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr, Boolean isNested, String& text)
  132. at NLog.Layouts.SimpleLayout.set_Text(String value)
  133. at NLog.Internal.PropertyHelper.TryNLogSpecificConversion(Type propertyType, String value, Object& newValue, ConfigurationItemFactory configurationItemFactory)
  134. at NLog.Internal.PropertyHelper.SetPropertyFromString(Object obj, String propertyName, String value, ConfigurationItemFactory configurationItemFactory)
  135. --- End of inner exception stack trace ---
  136. at NLog.Internal.PropertyHelper.SetPropertyFromString(Object obj, String propertyName, String value, ConfigurationItemFactory configurationItemFactory)
  137. at NLog.Config.XmlLoggingConfiguration.ConfigureObjectFromAttributes(Object targetObject, NLogXmlElement element, Boolean ignoreType)
  138. at NLog.Config.XmlLoggingConfiguration.AddArrayItemFromElement(Object o, NLogXmlElement element)
  139. at NLog.Config.XmlLoggingConfiguration.SetPropertyFromElement(Object o, NLogXmlElement element)
  140. at NLog.Config.XmlLoggingConfiguration.ParseTargetElement(Target target, NLogXmlElement targetElement)
  141. at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement(NLogXmlElement targetsElement)
  142. at NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String filePath, Boolean autoReloadDefault)
  143. at NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors)
  144.  
  145. <add assembly="NLog.Web.AspNetCore" />
Add Comment
Please, Sign In to add comment