Title

Message

Confirm

<< DiscussionsReply

Process cannot access log file because it is being used by LogFusion process

Avatar from Gravatar.com
Jeff Andrews1
8 discussion posts
I'm using LogFusion Pro 6.1.1 which I mainly purchased for the auto-scroll real-time update functionality to view my app's log as it is being generated. I like LogFusion a lot, but unfortunately, whenever I enable the "Auto-Scroll to Bottom" button, I am encountering numerous instances where the app which is generating the log file cannot access the log file because it is being used by another process.

Here's an example of such an error message that shows up in the log instead of the info that I am trying to generate:

Code



Is there a way to get LogFusion to use a lesser access mechanism when it polls the log file to read its updated contents? It seems like it's locking the file as if it needs write-access. Read-only-access shouldn't lock the file in a manner where the another process cannot update it, should it?

1.) Is there anything I might have configured incorrectly which is causing this situation?

2.) If not, is there anything that can be altered in a future LogFusion update to avoid these errors from occurring?

Thanks!

Regards,
= Jeff =
Mar 8, 2018  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
LogFusion only opens the file for reading and doesn't put locks on it. Is it only one specific app's logs that you're running into this issue with? We've never come across this here, so I'm not quite sure how to even test it.
Mar 8, 2018  • #2
Avatar from Gravatar.com
Jeff Andrews1
8 discussion posts
Thanks for the info, Keith.

I've only had LogFusion for 2 days thus far, and have only used it with a couple different types of logs. The logs with the access problem are being generated by an application which I am writing that requires a couple of Autodesk products, so it's not something I could easily send you.

It is clear though that the logs only have the error messages in them when I have the log files open in LogFusion and have the "Auto-Scroll to Bottom" functionality enabled. I was previously using Notepad++ to view the logs and I have a macro I made there to reload the file from disk whenever I hit a hotkey. But that was tedious, which is what drew me to LogFusion for the real-time automated updates. Unfortunately, for some reason, I can't use that feature or the log file cannot get written to properly.
Mar 8, 2018  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, I'm not sure where to go from here. I've checked with our devs, and LogFusion doesn't have any code that would be putting a lock on the file. The autoscroll button doesn't create any additional file handles either, it just tells LogFusion whether or not it should always keep the scroll bar at the bottom.

I'm wondering if antivirus might be at play here. Maybe when LogFusion is trying to read the file, your antivirus tries to scan it? Some antivirus apps will lock files while they're being scanned.
Mar 12, 2018  • #4
Avatar from Gravatar.com
Jeff Andrews1
8 discussion posts
No worries, Keith. Consider it a closed issue. You already provided plenty of assurance that LogFusion isn't doing anything directly which is out of the ordinary. It's likely an isolated occurrence due to something else about my system and I appreciate all the info you already provided. Thank you very much.

Regards,
= Jeff =
Mar 12, 2018  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
No worries at all, Jeff! If you have any further questions, please don't hesitate to ask!
Mar 12, 2018  • #6
Avatar from Gravatar.com
Jeff Andrews1
8 discussion posts
Hi Keith. I wonder if there might be anything else you can think of that LogFusion could possibly be doing with a log file. I do keep getting this exception every day and sure wish I could find a work-around. And it only occurs if I have LogFusion running with the log open and the Auto-Scroll To Bottom button engaged.

Apr 3, 2018  • #7
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Hi Jeff,

I double and triple checked the code, and all I could find in LogFusion that might block the log file from being read only happens when the log first opens. The only thing I can suggest in the meantime is maybe adding another parameter to your File.Open method, so your code expects other programs to read from it. Here's the code to try:

Code



I hope this helps, and I hope we can get to the bottom of this soon!
Apr 4, 2018  • #8
Avatar from Gravatar.com
Jeff Andrews1
8 discussion posts
Hi Thomas. Thank you very much for your reply. I think you may be onto something. Our logging code did not have the additional "FileShare.Read" parameter and I have since added it. As luck would have it, I cannot test that at the moment, but in the couple quick tests I was able to do, I did not encounter the error that I had previously encountered from time to time. I think you have probably solved this for me. Thanks again.
Apr 5, 2018  • #9
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Glad to hear that Thomas was able to help there! If you do still run into any trouble, please let us know.

Thanks!
Apr 5, 2018  • #10
Was this helpful?  Login to Vote(1)  Login to Vote
<< DiscussionsReply