The Loupe Agent needs a minimal configuration to identify the application, set the logging folder, and connect to a Loupe Server.
Once you've instrumented an application you'll want to set up a connection with Loupe Server so you can collect data from everywhere your application runs and start managing errors. You'll need to make a few changes to the configuration examples below to have them work:
- Replace "Your Loupe Service Name" with the name of your Loupe Cloud-hosted Service. If you don't have one yet, sign up for a free trial service.
- Replace "Your Product" and "Your Application" with friendly values for your application. A good analogy for Product is "Office" and Application is "Word", "Excel", and "PowerPoint".
Configuration via Properties File
Loupe can also be configured using properties files - loupe.properties for the name/value pair text properties format and loupe.xml for the XML file format. The properties file need only be placed on the classpath, and Loupe will detect and utilize it.
Configuration via Code
Loupe can be configured directly using its configuration object, for example:
AgentConfiguration configuration = AgentConfiguration.builder() .publisher(PublisherConfiguration.builder() .productName("Your Product") .applicationName("Your Application") .applicationVersion(new Version(1, 0, 0)).build()) .server(ServerConfiguration.builder() .useGibraltarService(true) .customerName("Your Loupe Service Name") .sendAllApplications(true).build()) .sessionFile(SessionFileConfiguration.builder() .folder("C:\\Temp").build()) .build();
The configuration object can then be injected in an explicit call to start Loupe:
Log.start(configuration);
Or, if using the loupe-api package:
Loupe.start(configuration);