Bismihi ta'ala
Secretly collecting information from someone could be done for various meanings, so we cannot say it is absolutely haram, or falls under spying. If it is the wife, who suspects her husband is engaging in extramarital relationships, then this is something that needs to be addressed, not just by "confirming" if suspicions are real.
I have discussed this in the following clip: