From: B. M. <dcc...@sb...> - 2016-11-30 20:54:22
|
Gerry, The direct cause of the reported "access is denied" fault is JMRI's attempt to create a "monitorLog.txt" file in your program directory, rather than the directory which is implied in the "choose file" dialog box. It is not a lack of a default file name! Normally, JMRI tries to put the monitor log file into the connection profile directory. Under certain circumstances (like the one you triggered below when you got the "access is denied" fault), JMRI will try to put that filename in your program directory. That is bad behavior on the part of JMRI, and it is tied directly to the use of the "Cancel" button on the file selection dialog box. If you could, please try the "interim development" build at http://jmri.tagadab.com/jenkins/job/Development/job/Packages/1029/ . This build has code modifications to prevent JMRI from incorrectly defaulting to the program directory for the monitor log file. Instead it defaults to the configuration profile directory. With this build, you should find that the problematic "access is denied" problem should not happen, and that you can always get a log file. Please let us know if this solves the problem where the expected logging run information is not overwritten by a new logging run to that same filename. The test sequences you've reported below ought to work without lost logging data with this "interim development" build. Regards, Bob M. From: Gerald Wolfson [mailto:wol...@gm...] Sent: Wednesday, November 30, 2016 12:21 PM To: Discussions between JMRI developers <jmr...@li...> Subject: Re: [Jmri-developers] add overwrite dialog to loconet monitor logging The fact that the monitorLog.txt file can be written to two places is news to me. Here is an new replay of the my sequence of logging on my computer. I am running JMRI 4.5.3 under Windows 10 on a ASUS Gamer laptop. In JMRI's Monitor LocoNet, I have both "Show raw data" and "Show timestamps" are checked as well as "Auto scroll" being checked. I started by going to both the program directory and the profile directory (C:\Users\wolfsong\JMRI\My_JMRI_Railroad) and deleting all copies of *.log and .txt files except install.log in program directory (note: did not find any other .log files there). I then went to Monitor LocoNet and did the following steps: 1. Pressed "Choose log lile" 2. Observed that the file name field is filled with "monitorLog.txt" 3. Observed that Save In: was set to "My_JMRI_Railroad". 4. Pressed "Save" to leave the dialog box. 5. Pressed "Clear screen" button. 6. Pressed "Start logging" 7. Rotated throttle on Zephyr back and forth several times. 8. Pressed "Stop logging" 9. Pressed "Freeze screen". Now went back into User Files location and refreshed that screen and saw that a new monitorLog.txt file was there and opened it in Notepad++. The content of the file and the Monitor LocoNet windows matched. Closed the text file and did the following steps: 1. Unfroze the Monitor LocoNet screen. 2. Pressed "Clear screen". 3. Pressed "Start logging". 4. Observed no error message in JMRI System Console. 5. Rotated throttle of Zephyr back and forth several times. 6. Pressed "Freeze screen" 7. Pressed "Stop Logging" 8. Observed still no error message in JMRI System Console. Now went back into User Files location and refreshed that screen and saw that there was still only one monitorLog.txt file in that directory. Opened it in Notepad++ and observed that it matched with the new data collected. Closed the text file and did the following steps: 1.Unfroze the Monitor LocoNet screen. 2. Pressed "Clear screen" 3. Pressed "Choose log file" 4. Pressed "Cancel" to exit dialog box 5. Pressed "Start Logging" 6. Rotated throttle several times. 7. Pressed "Stop Logging" 8. Pressed "Freeze screen" 9. Observed still no error messages in JMRI System Console. Now opened refreshed User Files directory window and opened only monitorLog.txt file. File again matched with Monitor LocoNet screen. Closed Panel Pro completely and then reopened. Then did the following: 1. Opened Monitor LocoNet (all checkboxes same as before) 2. Pressed "Choose log file" (see content is same as before) 3. Pressed "Cancel" to exit. 4. Pressed "Clear screen". 5. Pressed "Start logging" 6. Observed "2016-11-30 12:08:13,091 jmrix.AbstractMonPane ERROR - exception java.io.FileNotFoundException: monitorLog.txt (Access is denied) [AWT-EventQueue-0]" message in JRMI System Console window. 7. Rotated throttle several times. 8. Pressed "Stop Logging" 9. Pressed "Freeze screen" 10. Opened monitorLog.txt in Notepad++ 11. Observed data and timestamps were from the previous capture. Conclusion: When JMRI is launched, there is no default filename string prior to the "Choose log file" use and save. (didn't test to see what it would do on "Cancel" in this case.) The reason if showed up in my case was that I had to get out of Panel Pro to correct some script code which only gets loaded at JMRI launch and as a result my next logging of activity did not know the name of the last logging file I used nor did it have a default string without my having to go back into "Choose log file" and setting it again. I would suggest there be a default string or a warning that a name is not present if the "Start logging" button is pressed or remember the last name used for JRMI launch to launch. =gerry= |