Tour: Organizing and Filtering Log Entries
Both the libraries and the Console have features to organize, filter and categorize your log entries. The libraries let you group and organize your log entries with sessions, a filter event and log levels. The Console on the other hand has strong filtering capabilities which let you concentrate on the important parts of your log, individual threads and processes.
Sessions
By default, the libraries have one session named Main. You can create additional session objects to group your log entries and enable or disable entire log categories. Each session has a name and a color to identify, filter and highlight the corresponding log entries in the Console.
// Create a new session for client 982 Session blue = SiAuto.Si.AddSession("Client #982"); blue.Color = System.Drawing.Color.LightBlue; blue.LogMessage("Logged In"); ... // And another one for client 289 Session yellow = SiAuto.Si.AddSession("Client #289"); yellow.Color = System.Drawing.Color.LightYellow; yellow.LogMessage("Logged In");' Create a new session for client 982 Dim blue As Session = SiAuto.Si.AddSession("Client #982") blue.Color = System.Drawing.Color.LightBlue blue.LogMessage("Logged In") ... ' And another one for client 289 Dim yellow As Session = SiAuto.Si.AddSession("Client #289") yellow.Color = System.Drawing.Color.LightYellow yellow.LogMessage("Logged In")// Create a new session for client 982 Session blue = SiAuto.si.addSession("Client #982"); blue.setColor(java.awt.Color.BLUE); blue.logMessage("Logged In"); ... // And another one for client 289 Session yellow = SiAuto.si.addSession("Client #289"); yellow.setColor(java.awt.Color.YELLOW); yellow.logMessage("Logged In");{ Create a new session for client 982 } Blue := Si.AddSession('Client #982'); Blue.Color := clBlue; Blue.LogMessage('Logged In'); ... { And another one for client 289 } Yellow := Si.AddSession('Client #289'); Yellow.Color := clYellow; Yellow.LogMessage('Logged In');
The resulting log in the SmartInspect Console looks like the following image. The first View displays all entries of your log and newly created session Views show the log entries of a specific session only.
Views and Filters
You can create multiple Views with filters to view different parts of your log separately from each other. It is possible, for example, to have a View with all log entries and an additional View which shows errors only. Additionally, you can create Views that only contain log entries of a certain thread, process, session, host or application.
- Multiple Views let you concentrate on the important parts of your log. You can analyze log entries, processes and threads independently from each other and closely monitor the behavior of your application.
- You can group and organize views in so called View Categories and specify if a View displays a tree structure with call stack information or a flat list of log entries.
- You can set filters to specify which log entries are visible in the View. Filters can be combined for maximum flexibility. You can, for example, create a View which displays warnings and errors of a specific session or thread only.
Log Levels
You can specify a log level for each log entry to group your log entries by their severity. It is possible to specify the active log level of the libraries and thus decide which groups of log entries are logged and discarded.
SiAuto.Si.Level = Level.Warning; SiAuto.Si.LogError("Lost connection to client #982!"); // Is logged SiAuto.Si.LogObject(Level.Verbose, "client", client); // Is discardedSiAuto.Si.Level = Level.Warning SiAuto.Si.LogError("Lost connection to client #982!") ' Is logged SiAuto.Si.LogObject(Level.Verbose, "client", client) ' Is discardedSiAuto.si.setLevel(Level.Warning); SiAuto.si.logError("Lost connection to client #982!"); // Is logged SiAuto.si.logObject(Level.Verbose, "client", client); // Is discardedSi.Level := lvWarning; Si.LogError('Lost connection to client #982!'); { Is logged } Si.LogObject(Level.Verbose, 'client', client); { Is discarded }
"Thanks for such a great piece of software, SmartInspect. It is awesome. I debug high end multi-threaded servers and it is a life saver."
"I would highly recommend this product. This company has gone from nothing to having one of the most professional product experiences I have ever seen."