Name

ErrorDestination — route error messages to different files, based on message content or arbitrary tag

SYNOPSIS

tag_or_message filename

DESCRIPTION

The directive allows routing error messages to different files, based on either message content or an arbitrary tag.

This allows us to add message "routing" information at a single place in the catalog configuration, instead of having to provide file attribute to each invocation of error-related tags of functions.

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Routing error messages based on error message

ErrorDestination "Attempt to order missing product code: %s" logs/missing_products.log
ErrorDestination  "search error: %s" logs/search_errors.log

Example: Routing error messages based on an arbitrary tag

ErrorDestination missing_code logs/missing_product.log

Example: Logging in Perl and specifying a custom tag

::logError( 'Bad search column ' . $_, { tag => 'search' } );

NOTES

Specification of tag= does not currently work with [log type=error]...[/log].

AVAILABILITY

ErrorDestination is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 714

['ErrorDestination', 'hash',             ''],

Source: lib/Vend/Config.pm
Line 3188 (context shows lines 3188-3205)

sub parse_hash {
my($item,$settings) = @_;
if (! $settings) {
  return $HashDefaultBlank{$item} ? '' : {};
}

my $c;

if(defined $C) {
  $c = $C->{$item} || {};
}
else {
  no strict 'refs';
  $c = ${"Global::$item"} || {};
}

return hash_string($settings,$c);
}

AUTHORS

Interchange Development Group

SEE ALSO

ErrorFile(7ic)

DocBook! Interchange!