<?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: Meraki Log Location in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449067#M7638</link>
    <description>&lt;P&gt;Untested, but try configuring output_log.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/meraki/dashboard-api-python/blob/main/meraki/__init__.py#L79" target="_self" rel="nofollow noopener noreferrer"&gt;https://github.com/meraki/dashboard-api-python/blob/main/meraki/__init__.py#L79&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Untested (plan B), but right before (or maybe right afterwards) initialising the class, try adding:&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;import logging

...

logging.getLogger('meraki').addHandler(logging.FileHandler(f'cpmr_log_{datetime.datetime.now():%Y-%m-%d_%H-%M-%S}.log'))&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Oct 2023 01:43:41 GMT</pubDate>
    <dc:creator>Philip D'Ath</dc:creator>
    <dc:date>2023-10-18T01:43:41Z</dc:date>
    <item>
      <title>Meraki Log Location</title>
      <link>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449066#M7637</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I would like to know if there is a way to change where the .log file generated by the API is stored. I want this in a /logs/ dir, not in the current directory where my script lives.&lt;BR /&gt;&lt;BR /&gt;I don't want to suppress the log, nor do I want to manually or programmatically move it.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 21:30:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449066#M7637</guid>
      <dc:creator>ToryDavenport58911</dc:creator>
      <dc:date>2023-10-17T21:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Meraki Log Location</title>
      <link>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449067#M7638</link>
      <description>&lt;P&gt;Untested, but try configuring output_log.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/meraki/dashboard-api-python/blob/main/meraki/__init__.py#L79" target="_self" rel="nofollow noopener noreferrer"&gt;https://github.com/meraki/dashboard-api-python/blob/main/meraki/__init__.py#L79&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Untested (plan B), but right before (or maybe right afterwards) initialising the class, try adding:&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;import logging

...

logging.getLogger('meraki').addHandler(logging.FileHandler(f'cpmr_log_{datetime.datetime.now():%Y-%m-%d_%H-%M-%S}.log'))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2023 01:43:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449067#M7638</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2023-10-18T01:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Meraki Log Location</title>
      <link>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449068#M7639</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;dashboard = meraki.DashboardAPI(output_log=True, print_console=False, log_path='/logs/') 

# output_log (boolean): create an output log file? 
# log_path (string): path to output log; by default, working directory of script if not specified 
# print_console (boolean): print logging output to console?
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This configuration ensures that the log files generated by the API will be stored in the '/logs/' directory.&lt;/P&gt;&lt;P&gt;Let me knew if this resolve you issue?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 08:28:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449068#M7639</guid>
      <dc:creator>badreddine</dc:creator>
      <dc:date>2023-10-18T08:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Meraki Log Location</title>
      <link>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449069#M7640</link>
      <description>&lt;P&gt;I basically am implementing this already. I've overridden the log, actually its pretty neat because using python logging,  I can simply create a log where I want it and log away my info, warnings and errors for my script, but because I'm using the meraki module in the same runtime, all the meraki logs automatically are written in my new log within /logs. &lt;BR /&gt;&lt;BR /&gt;That said, the meraki api still creates the log file in the other dir, but it's blank.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 19:30:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449069#M7640</guid>
      <dc:creator>ToryDavenport58911</dc:creator>
      <dc:date>2023-10-18T19:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Meraki Log Location</title>
      <link>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449070#M7641</link>
      <description>&lt;P&gt;Worked! Thanks &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I had to declare the path as './logs/' &lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 20:41:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/meraki-log-location/m-p/5449070#M7641</guid>
      <dc:creator>ToryDavenport58911</dc:creator>
      <dc:date>2023-10-18T20:41:26Z</dc:date>
    </item>
  </channel>
</rss>

