Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

More than one app writing to the same log


#1

Hello,

I have recently tested behaviour of two instances of the same application running to the same log. It looks like that file writing is cached and based on “last wins” rule.
If I don’t implement any single instance checking inside application - is there any way to detect situation when two or more processes are writing to the same log file?

best regards
Piotr Rezmer


#2

Hello Piotr,

Thanks for your posting. You can use the OnError event to detect this situation. Writing to the same log file from two processes is not supported directly by the libraries and this will raise an error in one of the two processes. We recommend adding a unique identifier to the log file so that each process always gets its own log file. You can still open the two logs at the same time in the SmartInspect Console (and even sort the combined log in a single view if needed, see File | Sort Log).

Regards,
Dennis