<?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 Python API Server Log ignoring time filter? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1214769#M7786</link>
    <description>&lt;P&gt;Not really sure how best to title this, sorry.&lt;/P&gt;&lt;P&gt;Using the Python API guide as a follow-along for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/python/guide/managing-your-gis-servers/" target="_self" rel="nofollow noopener noreferrer"&gt;'managing your gis servers'&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The query itself is working but seems to be ignoring the time filter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1663612354750.png" style="width: 998px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51789i0E28B4DA7AE05476/image-size/large?v=v2&amp;amp;px=999" role="button" title="1663612354750.png" alt="1663612354750.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;comparing to the GUI in Sever Manager I'm not lining up these times with anything.&lt;STRONG&gt; I can supply any argument I want for start_time and no error is returned:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1663612559970b.png" style="width: 662px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51791iCF7E8CC1DA8DCE09/image-size/large?v=v2&amp;amp;px=999" role="button" title="1663612559970b.png" alt="1663612559970b.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If I leave out the 'start_time' parameter entirely, the query returns exactly what I'm seeing in the Server Manager GUI exactly.&lt;/P&gt;&lt;P&gt;I'm I using start_time wrong? (Or is my understanding of it incorrect?)&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 18:56:28 GMT</pubDate>
    <dc:creator>ZacharyHart</dc:creator>
    <dc:date>2022-09-21T18:56:28Z</dc:date>
    <item>
      <title>Python API Server Log ignoring time filter?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1214769#M7786</link>
      <description>&lt;P&gt;Not really sure how best to title this, sorry.&lt;/P&gt;&lt;P&gt;Using the Python API guide as a follow-along for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/python/guide/managing-your-gis-servers/" target="_self" rel="nofollow noopener noreferrer"&gt;'managing your gis servers'&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The query itself is working but seems to be ignoring the time filter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1663612354750.png" style="width: 998px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51789i0E28B4DA7AE05476/image-size/large?v=v2&amp;amp;px=999" role="button" title="1663612354750.png" alt="1663612354750.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;comparing to the GUI in Sever Manager I'm not lining up these times with anything.&lt;STRONG&gt; I can supply any argument I want for start_time and no error is returned:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1663612559970b.png" style="width: 662px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51791iCF7E8CC1DA8DCE09/image-size/large?v=v2&amp;amp;px=999" role="button" title="1663612559970b.png" alt="1663612559970b.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If I leave out the 'start_time' parameter entirely, the query returns exactly what I'm seeing in the Server Manager GUI exactly.&lt;/P&gt;&lt;P&gt;I'm I using start_time wrong? (Or is my understanding of it incorrect?)&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 18:56:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1214769#M7786</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-09-21T18:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python API Server Log ignoring time filter?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1218359#M7841</link>
      <description>&lt;P&gt;So I decided to test this for Portal logs too and it works just as expected there.&lt;/P&gt;&lt;P&gt;If I only filter for a start_time of 1 day ago i'm getting back hundreds of entries going back a month or so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;now = datetime.datetime.now()
StartTime = now - datetime.timedelta(hours=1)
StartTime

ServerLogs = server1.logs.query(level = 'SEVERE',start_time = StartTime)
ServerLogs&lt;/LI-CODE&gt;&lt;P&gt;If i use the GUI in Server Manager with the same filter, I see 4 entries.&lt;/P&gt;&lt;P&gt;Any querying from the API and the Portal log GUI however match exactly.&lt;/P&gt;&lt;P&gt;The reference documentation for arguments is slightly different from &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.admin.html#logs" target="_self"&gt;Portal&lt;/A&gt; to &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.server.html#server" target="_self"&gt;Server&lt;/A&gt; however...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyHart_0-1664819129626.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52744i6DB94384EE8473C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="ZacharyHart_0-1664819129626.png" alt="ZacharyHart_0-1664819129626.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyHart_1-1664819190568.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52745i6C941FFD272091BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="ZacharyHart_1-1664819190568.png" alt="ZacharyHart_1-1664819190568.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 17:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1218359#M7841</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-10-03T17:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python API Server Log ignoring time filter?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1538130#M10659</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/194227"&gt;@ZacharyHart&lt;/a&gt;&amp;nbsp;&amp;nbsp;Did your datetime filtering issue have been resolved or are you still looking for a solution?&lt;/P&gt;&lt;P&gt;Has anybody experienced the same problem?&lt;/P&gt;&lt;P&gt;It appears that the issue still persists in the latest released version despite a &lt;A href="https://support.esri.com/en-us/bug/executing-arcgisgisserverlogmanagerquery-method-returns-bug-000149808" target="_self"&gt;bug&lt;/A&gt; for the same issue.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bug ID: &lt;A href="https://support.esri.com/en-us/bug/executing-arcgisgisserverlogmanagerquery-method-returns-bug-000149808" target="_self"&gt;BUG-000149808&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 05:35:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-server-log-ignoring-time-filter/m-p/1538130#M10659</guid>
      <dc:creator>AnjulPandey</dc:creator>
      <dc:date>2024-09-13T05:35:46Z</dc:date>
    </item>
  </channel>
</rss>

