The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ptee - multicast your logs

VERSION

This document refers to version 1.0003 of ptee

PURPOSE

Use this program somewhat like the unix tee(1) command, to send text input to multiple destinations, for example a log file, Syslog, and so on.

DESCRIPTION

The unix tee(1) command accepts text on standard input, and emits that same text back out on standard output whilst also appending it to a log file.

This program is similar, but more flexible, in that you can specify other destinations, and have as many as you like. By default it operates in pass-through mode; text received is simply emitted straight back out on standard output.

USAGE

Configuration is provided in the format used by the Perl module Log::Dispatch::Config. This is a wrapper around the excellent Log::Dispatch perl module, which is the tool that provides all your output destinations.

The best thing to do is read the manual page for these two modules - don't worry they are not complicated. Once you have done that, you can write your own configuration file.

You can use many different formats of configuration file. Please read the Config::Any Perl module manual for more details. Here is a simple example which will emit logs to standard output and a file, much like the unix utility tee(1):

 dispatchers : [file, screen]
  
 file:
   class : 'Log::Dispatch::File'
   min_level : debug
   filename : '/path/to/log'
   mode : append
   format : '[%d] [%p] %m at %F line %L%n'
  
 screen:
   class : 'Log::Dispatch::Screen'
   min_level : info
   stderr : 1
   format : '%m'

The above file is in YAML format, a good choice, and so if you save this as /etc/ptee.yml it will be loaded and used.

Alternatively, you can specify the file name in the PTEE_CONFIG environment variable, or as the first command line parameter to ptee itself. This gives you the ability to use a different file format, but please read the manual page for the Log::Dispatch::Configurator::Any Perl module in that case to avoid a couple of minor pitfalls.

AUTHOR

Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>

COPYRIGHT & LICENSE

Copyright (c) The University of Oxford 2008.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.