<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Example of Setting Up Logging (for Example NLog) with Add-In Project in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1487149#M11627</link>
    <description>&lt;P&gt;Used log4net.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(typeof(T));&lt;/P&gt;&lt;P&gt;log4net.Config.XmlConfigurator.Configure(new FileInfo("logger.config"));&lt;/P&gt;&lt;P&gt;logger.Debug("Test");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;logger.config (eg): property "Copy Always" for this file has to be set, so it gets copied to bin build folder (wonder how this will get bundled with the esriAddinX file...)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&amp;lt;log4net&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!-- Pattern to output the caller's file name and line number --&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/layout&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/appender&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender name="RollingFile" type="log4net.Appender.RollingFileAppender"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!--&amp;lt;file type="log4net.Util.PatternString" value="c:\log\logname-%utcdate{yyyy-MM-dd-HH-mm-ss}.log" /&amp;gt;--&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;file value="c:\log\EGIS.ALM.Pro.SourceNode.log" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appendToFile value="true" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;rollingStyle value="Size" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;maximumFileSize value="10000KB" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;maxSizeRollBackups value="20" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;conversionPattern value="%date [%-4thread] %-5level %logger - %message%newline"/&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!--&amp;lt;conversionPattern value="%date [%-4thread] %-5level %logger{1} - %message%newline"/&amp;gt;--&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/layout&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/appender&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;root&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;level value="DEBUG" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;level value="WARN" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;level value="INFO" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender-ref ref="Console" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender-ref ref="RollingFile" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/root&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;/log4net&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;configured for each class library... however can put the static initializations into a class and call the class method.&lt;/DIV&gt;</description>
    <pubDate>Fri, 07 Jun 2024 12:58:48 GMT</pubDate>
    <dc:creator>Gurunara</dc:creator>
    <dc:date>2024-06-07T12:58:48Z</dc:date>
    <item>
      <title>Example of Setting Up Logging (for Example NLog) with Add-In Project</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1485838#M11617</link>
      <description>&lt;P&gt;Is there example of Setting Up Logging (for Example NLog) with Add-In Project?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 05:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1485838#M11617</guid>
      <dc:creator>Gurunara</dc:creator>
      <dc:date>2024-06-06T05:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Setting Up Logging (for Example NLog) with Add-In Project</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1485842#M11620</link>
      <description>&lt;P&gt;using nlog.config (at root level):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;!-- XSD manual extracted from package NLog.Schema: &lt;A href="https://www.nuget.org/packages/NLog.Schema--" target="_blank"&gt;https://www.nuget.org/packages/NLog.Schema--&lt;/A&gt;&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;nlog xmlns="&lt;A href="http://www.nlog-project.org/schemas/NLog.xsd" target="_blank"&gt;http://www.nlog-project.org/schemas/NLog.xsd&lt;/A&gt;" xsi:schemaLocation="NLog NLog.xsd"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; autoReload="true"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; internalLogFile="c:\\logs\\console-example-internal.log"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; internalLogLevel="Info"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!-- the targets to write to --&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;targets&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!-- write logs to the files --&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;target xsi:type="File" name="all_logs_file" fileName="c:\\logs\\all.log"/&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;target xsi:type="File" name="important_logs_file" fileName="c:\\logs\\important.log"/&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!-- write logs to the console--&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;target xsi:type="ColoredConsole" name="logconsole" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/targets&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!-- rules to map from logger name to target --&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;rules&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;logger name="*" minlevel="Trace" writeTo="logconsole" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;logger name="*" minlevel="Debug" writeTo="all_logs_file" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;logger name="*" minlevel="Warn" writeTo="important_logs_file" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/rules&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;/nlog&amp;gt;&lt;BR /&gt;&lt;BR /&gt;and from constructor of viewmodel:&lt;BR /&gt;&lt;BR /&gt;private static Logger logger = LogManager.GetCurrentClassLogger();&lt;BR /&gt;&lt;BR /&gt;logger.Info("Some message");&lt;BR /&gt;&lt;BR /&gt;but nothing gets output to the log directory&amp;nbsp;c:\\logs\\&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Jun 2024 05:31:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1485842#M11620</guid>
      <dc:creator>Gurunara</dc:creator>
      <dc:date>2024-06-06T05:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Setting Up Logging (for Example NLog) with Add-In Project</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1487149#M11627</link>
      <description>&lt;P&gt;Used log4net.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(typeof(T));&lt;/P&gt;&lt;P&gt;log4net.Config.XmlConfigurator.Configure(new FileInfo("logger.config"));&lt;/P&gt;&lt;P&gt;logger.Debug("Test");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;logger.config (eg): property "Copy Always" for this file has to be set, so it gets copied to bin build folder (wonder how this will get bundled with the esriAddinX file...)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&amp;lt;log4net&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!-- Pattern to output the caller's file name and line number --&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/layout&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/appender&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender name="RollingFile" type="log4net.Appender.RollingFileAppender"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!--&amp;lt;file type="log4net.Util.PatternString" value="c:\log\logname-%utcdate{yyyy-MM-dd-HH-mm-ss}.log" /&amp;gt;--&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;file value="c:\log\EGIS.ALM.Pro.SourceNode.log" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appendToFile value="true" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;rollingStyle value="Size" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;maximumFileSize value="10000KB" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;maxSizeRollBackups value="20" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;conversionPattern value="%date [%-4thread] %-5level %logger - %message%newline"/&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;!--&amp;lt;conversionPattern value="%date [%-4thread] %-5level %logger{1} - %message%newline"/&amp;gt;--&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/layout&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/appender&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;root&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;level value="DEBUG" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;level value="WARN" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;level value="INFO" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender-ref ref="Console" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;appender-ref ref="RollingFile" /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/root&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;/log4net&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;configured for each class library... however can put the static initializations into a class and call the class method.&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Jun 2024 12:58:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/example-of-setting-up-logging-for-example-nlog/m-p/1487149#M11627</guid>
      <dc:creator>Gurunara</dc:creator>
      <dc:date>2024-06-07T12:58:48Z</dc:date>
    </item>
  </channel>
</rss>

