Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

arcrest.manageags.administration.Log.query() returns all log entries regardless of startTime and endTime parameters #26

Closed
sagewall opened this issue Jan 20, 2015 · 5 comments
Assignees

Comments

@sagewall
Copy link

I am having an issue using the arcrest.manageags.administration.Log class. I think there may be an issue with line 1268 where the params['startTime'] = endTime.strftime("%Y-%m-%dT%H:%M:%S"). Seems like it should be params['endTime'] = endTime.strftime("%Y-%m-%dT%H:%M:%S"). In any event the function seems to be returning all log entries..

@sagewall sagewall changed the title arcrest.manageags.administration.Log.query returns all log entries regardless of startTime and endTime parameters arcrest.manageags.administration.Log.query() returns all log entries regardless of startTime and endTime parameters Jan 20, 2015
@achapkowski
Copy link
Collaborator

What version of ArcGIS Server are you using?
Can you please provide the code that is failing so I can try to reproduce the issue?

Thank you

@achapkowski achapkowski self-assigned this Jan 21, 2015
@sagewall
Copy link
Author

Using ArcGIS Server 10.2.

Code below

import jeffco
import base64
import arcrest
import json
from datetime import datetime
from datetime import timedelta

credentials = jeffco.credentials.ArcGISServerCredentials("advagi002")
username = base64.b64decode(credentials.username)
password = base64.b64decode(credentials.password)
securityHandler = arcrest.AGSTokenSecurityHandler(username, password, r"http://advagi001/arcgis/tokens/")

log_url = r"http://advagi002:6080/arcgis/admin/logs"
log = arcrest.manageags.administration.Log(log_url, securityHandler)
#print log.countErrorReports()
print log.logSettings
#print log.query()


endTime = datetime.now()
startTime = endTime - timedelta(minutes=30)


log_data = log.query(startTime, endTime, "", "WARNING")
print log_data
for log_message in log_data["logMessages"]:
    print log_message

When I change the code as described in my original comment the function works as expected limiting the results to be in between the start and end times.

Thanks,
Sage

@achapkowski
Copy link
Collaborator

Thanks Sage for this information, I will take a look at this.

@achapkowski
Copy link
Collaborator

Issue fixed, please pull the new version. Thank you for letting us know about this issue.

@sagewall
Copy link
Author

Thank you for fixing it so quickly and for this great python package.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants