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

Separate logging for dlls


I wish to distribute a dll that includes SI logging. It is possible that the dll will be used in applications that already have SI configured/usage so I want to have my dll’s SI as a completely separate/standalone logger.

Is it possible to create separate loggers as distinct from separate sessions.

I can’t seem to create separate instances of SI in C#. If it is, some basic code example would be great.

Thank you.


Typical, I find the answer as soon as I post :slight_smile:

			Gurock.SmartInspect.SmartInspect si = new Gurock.SmartInspect.SmartInspect("Test");
		si.Connections =
			string.Format("file(append = \"true\", filename = \"{0}\", async.enabled = \"true\"), pipe()", logFile);
		si.DefaultLevel = Gurock.SmartInspect.Level.Debug;
		si.Enabled = true;
		si.SessionDefaults.Color = System.Drawing.Color.Black;