- Set the MFTRACE_CONFIG environment variable to point to the
ctf.cfg configuration file, before you invoke the application. For example:
Windows:
set MFTRACE_CONFIG=c:\ctf\ctf.cfg
UNIX:
export MFTRACE_CONFIG=/home/usr/ctf/ctf.cfg
You can set this environment variable in a debug configuration, so that the trace is automatically enabled when you debug
with this configuration.
- Set the MFTRACE_LOGS environment variable to specify the location in which to create the CTF trace files. If MFTRACE_LOGS
is not set, the current folder is used.
Note: Both the 32- and 64-bit
Enterprise Developer command prompts set MFTRACE_LOGS to
%ProgramData%\Micro Focus\Enterprise Developer\x.x\mftrace\logs.
- Edit the configuration file to specify the information to trace, for example:
mftrace.dest = binfile
mftrace.emitter.binfile#location = c:\logs (Windows) or
/home/usr/logs (UNIX)
mftrace.level.mf.rts = info
mftrace.comp.mf.rts#pgm = true
mftrace.comp.mf.rts#pgmload = true
mftrace.comp.mf.rts#syspgm = true
Note: If the location of the trace file is specified in the configuration file, as shown above, it overrides the MFTRACE_LOGS setting.
- Run the application from the environment you set up.
If you are using a JVM environment, you can also configure CTF tracing by using an
mfjvm.ctf file, ensuring it is stored on the program's classpath. The format of this file is the same as the
ctf.cfg file and is typically used when tracing web applications is required.
You can ensure the file is on the classpath by:
- Specifying the path name to the directory the file is stored in, using the standard JVM CLASSPATH system variable.
- Placing it in the root of a
.jar file that is itself on the classpath.
- Placing it in the
WEB-INF/classes directory of a web services
.war file.
Note: If the MFTRACE_CONFIG variable is also set, that is used in preference to this method.