# Enabling tracing

- ## Per handle

  $h->{TraceLevel} = $level;
  $h->trace($level);
  $h->trace($level, $filename); # $filename used for all handles
- Trace level only affects that handle and any new child handles created from it
- Child handles get trace level of parent in effect at time of creation
- Can be set via DSN: "dbi:Driver(TraceLevel=2):…"

- ## Global (internal to application)

  DBI->trace(...);
- Sets effective global default minimum trace level

- ## Global (external to application)

  - Enabled using DBI_TRACE environment variable
    DBI_TRACE=digits same as DBI->trace(digits);
    DBI_TRACE=digits=filename same as DBI->trace(digits, filename);

Previous slide | Next slide | Back to first slide | View graphic version