File: send

package info (click to toggle)
liblog-dispatch-message-passing-perl 0.009-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 280 kB
  • sloc: perl: 1,406; makefile: 9; sh: 4
file content (24 lines) | stat: -rwxr-xr-x 637 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env perl
use strict;
use warnings;

use Log::Dispatch;
use Log::Dispatch::Message::Passing;
use Message::Passing::Filter::Encoder::JSON;
use Message::Passing::Output::ZeroMQ;

my $log = Log::Dispatch->new;

$log->add(Log::Dispatch::Message::Passing->new(
      name      => 'myapp_aggregate_log',
      min_level => 'debug',
      output    => Message::Passing::Filter::Encoder::JSON->new(
        output_to => Message::Passing::Output::ZeroMQ->new(
            connect => 'tcp://127.0.0.1:5558',
        ),
     ),
));
$log->warn($_) for qw/ foo bar baz /;

sleep 1; # Allow time for ZeroMQ to actually flush the messages..