LoggingThe ability to save the files from a BlackBadger run cycle is an essential part of post analysis, whether checking the test results are as expected or running through the log files to find out why the run failed unexpectedly. So with that, BlackBadger provides some convenience in the form of a logfile Ant task (a task that is built-in to the modified Ant deployment that ships with BlackBadger). This task will collect the files specified and transfer them to a file repository on the Master. The logfile task is designed to be used as part of the termination process (i.e. it should be used in the 'terminate' target) so that files are logged whether the run completes successfully or not. The task has no attributes, it simply expects embedded <fileset> elements to specify the files to be collected. Here's an example of one that might appear in the Apache component: <property name="home" value="/opt/dev/apache/httpd/"/> ... <target name="terminate"> ... <logfile> <fileset dir="${home}"> <include name="logs/*"/> </fileset> </logfile> ... This will transfer all the files in the "/opt/dev/apache/httpd/logs/" directory to the Master. The precise location where they're stored on the Master is dependent on the NAME attribute specified in the <system>, the date/time of the run and the ID of the agent from which the files are transferred. This provides a way to easily identify which files were recorded for each agent on any specific run of a given test. So continuing with the apache component used in the example above, consider the following simple system xml that will make use of it. <system name="testlogging"> <agent id="apacheagent"> <group id="web"> <comp base="apache" id="apachecomp"/> </group> </agent> <system> If we were to run BlackBadger from the '/home/blackbadger' directory using this configuration, the end results should be the creation of a directory with the path '/home/blackbadger/logs/testlogging/2006_07_26_102704/apacheagent' in which there should be access_log, error_log and ssl_request_log files sitting in a 'logs' directory. Naturally the date/time element of that directory path will vary depending on the start date/time of the run in question but essentially the end result is a directory structure that is easy to browse for the given logs files you need. |