How can Java EE traces be initiated from command line
You can use a Groovy script to collect single traces. In Groovy, request types are specified by a regular expression, so the same set of single trace criteria can be used for a group of request types.
When you have a group of request types for which you want to collect single traces using the same criteria, you set the criteria using a Groovy script called from the command line (for example, using fglcmd). The collected single traces are stored on the Foglight Management Server, and displayed in the Custom Applications Monitor Requests tab for users to review. Use the following function to trigger the collection of requested traces.
For details about instrumentation levels, see “Configuring Instrumentation” in the Managing Java EE Systems: Installation and Configuration Guide.
Criteria are in milliseconds.
// Collect 5 traces in full detail for request "GET /samples/test.do" for 15 minutes
// only if response time is over 1 minute for the agent where name contains adtomcat
topSvc = server.get("QueryService");
// appServer is the server topology object
appServer = topSvc.queryTopologyObjects("TomcatServer where name like '%adtomcat%'");
def agentNameIDs = ;
def criteria = ;
JEECollectTraces("GET /samples/test.do", false, 900, 5, false,false,false, criteria, agentNameIDs);