in reply to Re: Win32 multiple process and single file redirection
in thread Win32 multiple process and single file redirection
I will try with Log::Agent ("dispatch" seems aimed at the opposite, that is log one same things to different places, err ... ).
#!perl package MyProjectPackage ; use strict ; use warnings ; use Win32::Process ; my $MLIB ; BEGIN { $MLIB = "c:/zlr" ; } use lib ( $MLIB . "/lib/" , $MLIB . "/lib/Perl/" ) ; use Log::Dispatch ; use Log::Dispatch::File ; my $dispatcher = Log::Dispatch->new ; my $MSOFT = "c:/zlr/script/test" ; my $call_hProcess = "" ; my $call_Resultat = 0 ; my $i = 0 ; $dispatcher->add( Log::Dispatch::File->new( name => 'MyProjectErrT1', min_level => 'info', filename => "$MSOFT/ErrGeneral.txt" ) ); $dispatcher->log( level => 'info', message => 'Start of log' ); $call_Resultat = Win32::Process::Create($call_hProcess, "c:/Perl/bin/Perl.exe", "perl t2.pl", 0, IDLE_PRIORITY_CLASS, "." ) ; $call_Resultat = Win32::Process::Create($call_hProcess, "c:/Perl/bin/Perl.exe", "perl t3.pl", 0, IDLE_PRIORITY_CLASS, "." ) ; while ( $i < 20 ) { sleep 10 ; $dispatcher->log( level => 'info', message => "Launcher : $i\n" ); $i++ ; }
#!perl # Pragmas package MyProjectPackage ; use strict ; use warnings ; use Win32::Process ; my $MLIB ; BEGIN { $MLIB = "c:/zlr" ; } use lib ( $MLIB . "/lib/" , $MLIB . "/lib/Perl/" ) ; use Log::Dispatch ; use Log::Dispatch::File ; my $dispatcher = Log::Dispatch->new ; my $MSOFT = "c:/zlr/script/test" ; my $call_hProcess = "" ; my $call_Resultat = 0 ; my $i = 0 ; $dispatcher->add( Log::Dispatch::File->new( name => 'MyProjectErrT2', min_level => 'info', filename => "$MSOFT/ErrGeneral.txt" ) ); $dispatcher->log( level => 'info', message => 'Start of t2' ); while ( $i < 20 ) { sleep 10 ; $dispatcher->log( level => 'info', message => "t2.pl : $i\n" ); $i++ ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32 multiple process and single file redirection
by pelagic (Priest) on Jan 21, 2005 at 13:56 UTC | |
|
Re^3: Win32 multiple process and single file redirection
by Frantz (Monk) on Jan 25, 2005 at 16:39 UTC |