Within Loupe a Session corresponds to a process lifespan (in .NET Framework it's slightly narrower - an Application Domain's lifespan). This means once the Loupe Agent is started the session will continue until the process shuts down. Each session is assigned a unique Id when it starts which is used to track that session through its full lifecycle between the Agent, Server, and other clients.
As long as the session is running it records data into a session data file with the extension .glf. These are highly compressed binary files which contain metadata about the application as well as the log, metric, and other runtime data recorded by your application. These files are automatically managed by the agent with each file being closed when it reaches a maximum size or age (which are configurable). These files are stored in a child folder of the Common Application Data folder on each computer where the session runs.
A session is started when the Loupe Agent initializes. It will initialize when:
Initialization can be canceled by subscribing to the Log.Initializing event and setting the Cancel event property to true.
Once it's initialize the Agent will be active until the application domain exits.
Due to certain internal details of the Loupe Agent (in particular the goal of ensuring no log messages are lost, even when a process is exiting) it will keep an application domain running unless it's told to end the session.
To do this, call Log.EndSession. When you do this, the Agent changes its behavior in several ways: