Enable Logging
- Search for the nlog.config file inside the Website installation directory.
- Open it with notepad.
Change the value of the minLevel variable from "Info" to "Trace"
<variable name="minLevel" value="Info" /> <!-- to --> <variable name="minLevel" value="Trace" />
- Recycle the Application Pool or restart the Website
Example Content of the nlog.config for Trace logging:
<?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"> <variable name="minLevel" value="Trace" /> <extensions> <add assembly="NLog.Web.AspNetCore"/> </extensions> <targets> <target name="logFileDefaultAsync" xsi:type="AsyncWrapper"> <target name="logFileDefault" xsi:type="File" fileName="App_Data/Logs/log.txt" header="EnterpriseGlossary: ${assembly-version:type=Assembly}" layout="[${date}] [${processid}] [${level}] [${logger}] [${callsite:className=False:includeNamespace=False:includeSourcePath=False}] ${message} ${exception:format=tostring}" footer="EnterpriseGlossary: ${assembly-version:type=Assembly}" archiveEvery="Day" archiveNumbering="Date"/> </target> </targets> <rules> <logger name="*" minlevel="${var:minLevel}" writeTo="logFileDefaultAsync" /> <!--Skip non-critical Microsoft logs and so log only own logs--> <logger name="Microsoft.*" maxlevel="Info" final="true" /> </rules> </nlog>
Example Content of the nlog.config with minimal logging:
<?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"> <variable name="minLevel" value="Info" /> <extensions> <add assembly="NLog.Web.AspNetCore"/> </extensions> <targets> <target name="logFileDefaultAsync" xsi:type="AsyncWrapper"> <target name="logFileDefault" xsi:type="File" fileName="App_Data/Logs/log.txt" header="EnterpriseGlossary: ${assembly-version:type=Assembly}" layout="[${date}] [${processid}] [${level}] [${logger}] [${callsite:className=False:includeNamespace=False:includeSourcePath=False}] ${message} ${exception:format=tostring}" footer="EnterpriseGlossary: ${assembly-version:type=Assembly}" archiveEvery="Day" archiveNumbering="Date"/> </target> </targets> <rules> <logger name="*" minlevel="${var:minLevel}" writeTo="logFileDefaultAsync" /> <!--Skip non-critical Microsoft logs and so log only own logs--> <logger name="Microsoft.*" maxlevel="Info" final="true" /> </rules> </nlog>
© 2023 bluetelligence GmbH. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of bluetelligence GmbH. The information contained herein may be changed without prior notice. bluetelligence and Enterprise Glossary and their respective logos are trademarks or registered trademarks of bluetelligence GmbH. SAP, ABAP, BAPI, SAP NetWeaver, SAP BI, SAP BW, SAC, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany or an SAP affiliate company. All other product and service names mentioned are the trademarks of their respective companies.
Impressum – Legal Notice: https://bluetelligence.de/en/imprint
Privacy policy: https://www.enterprise-glossary.de/datenschutz.php
Atlassian privacy policy: https://www.atlassian.com/legal/privacy-policy