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

Get name of log file



I createed SmartInspect object with connection string

m_logger = new SmartInspect(AppName); logger.Connection = "file(filename=\"file_name\", append=true, rotate=daily)";

As I have read in documentation, in this mode, I’ll get a file with name, generated in format “file_name-yyyy-MM-dd-HH-mm-ss”. How can I get current filename in run-time?




there’s currently no API for this in the SmartInspect library. A workaround for this would be to check the target directory of your log file for the created log files (Directory.EnumerateFiles should work for this, for example). The newest log file is the currently active log. I hope this helps.



Thanks for reply.