-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change location of log file in REDCap #19
Comments
Karl will review |
Feedback from Karl: Hi Chuck! After getting my PIP updates done, I don’t have much other feedback than what I typed in the lists below. I’ve attached my redcapToCdm.py, just in case you want to diff it (like I said, though, I’m sticking with some of the directory navigation stuff rather than direct entry in config.ini, mostly because of the too-high-level error message when I fail to update config.ini for a migration to my Prod directory). The only thing I will add is that using the logger outside of the loadConfigFile() method isn’t working for me e.g. the “Finished REDCap ETL…” statement at the end does not get logged for me. I suspect maybe the logger is only attached within that method scope. I meant to try moving the basicConfig() call to global scope, but haven’t gotten to it. But you can make the patch as review by me. Thanks! |
Hi Chuck!
I’m not sure if anyone else has this problem, but I do not have access to the directory where my Python interpreter lives (error below). Since I would also prefer to log adjacent to the code I’m executing, I patched up the redcapToCdm.py with the code fragment at the bottom, with my stuff in bold.
I’m not sure if you would want to merge something like this into the file. I’m not going to put in a pull request, since I have other JHU-specific code in our file you wouldn’t be interested in.
Thanks!
Karl
Traceback (most recent call last):
File "U:\PCORI\Dev\PRO\path-redcap-to-cdm-1.1-JHUMerge\path-redcap-to-cdm-master\redcapToCdm.py", line 717, in
logging.basicConfig(filename='redcap.log.' + str(os.getpid()),level=logging.DEBUG, format='%(asctime)s: %(levelname)s - %(message)s')
File "e:\python27\lib\logging_init_.py", line 1540, in basicConfig
hdlr = FileHandler(filename, mode)
File "e:\python27\lib\logging_init_.py", line 911, in init
StreamHandler.init(self, self.open())
File "e:\python27\lib\logging_init.py", line 936, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: 'C:\Windows\system32\redcap.log.3952'
if name == "main":
# use this command to disable the InsecurePlatformWarning (see http://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package)
requests.packages.urllib3.disable_warnings()
The text was updated successfully, but these errors were encountered: