Posts

Showing posts with the label NLog

No EventLog for Aspnet Core with Nlog

 If you trying to pass a json object you can still do so just not with the EventLog object. Instead just use the MS LogIformation method with the object as your parameters. I still havent got it to format the json object in the logs but for now this is a solution. Another solution is to pull the nlog object in and not use the MS LogInformation in Logger log = LogManager.GetCurrentClassLogger();  I haven't done this yet but I dont see a logical issue just bad design  https://github.com/NLog/NLog/issues/2106 https://stackoverflow.com/questions/39099601/how-can-i-configure-json-format-indents-in-asp-net-core-web-api https://github.com/NLog/NLog/issues/2629 https://stackoverflow.com/questions/34679727/use-nlog-in-asp-net-core-application https://stackoverflow.com/questions/44048187/layout-nlog-properties-as-json Example:  https://github.com/NLog/NLog.Web/blob/master/examples/ASP.NET%20Core%203/ASP.NET%20Core%203%20-%20VS2019/Controllers/HomeController.cs https://github.com/NLog/NLog/wi

NLog 4.6.2 Console Application

For most of our configuration we use the App.config file. If you do not have one, create one and copy a .csproj project’s build configs for handling App.config files or simply start a project with App.config in the visual studio template. Based on .Net framework Console Applications under the .Net 4.7.2 Framework using NLog 4.6.2 however later versions may work just as well. In the start of the App.config add the following... < configSections >     < section name= "nlog" type= "NLog.Config.ConfigSectionHandler, NLog" />   </ configSections >   < nlog throwExceptions= "true" xmlns= "http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" >     < targets >           < target name= "database" xsi:type= "Database" dbProvider= "System.Data.SqlClient"               connectionString= "$ {gdc:item=databaseStr} "        

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql