[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-beginners
Subject:    Antw: How to print errors to both STDERR & a file?
From:       "Stephane Schmuck" <stephane.schmuck () postbank ! de>
Date:       2009-06-25 13:57:07
Message-ID: 26188661.736.1245938233352.JavaMail.root () ls0008bz
[Download RAW message or body]

Hello !

here my hint :

#!/usr/bin/perl

use strict;
use warnings;

use Log::Log4perl qw(:easy);

Log::Log4perl->easy_init(
{
  file => ">> my_error_log",
  level => $ERROR,
},
{
  file => "STDERR",
  level => $ERROR,
}
);

For more informations see http://log4perl.sourceforge.net 


Stéphane
 
> > > <pablo@compugenic.com> 24.06.2009 18:25 >>>
I'd like to automatically have my script's errors and warnings sent to
both STDOUT (console) and a log file.  What is the proper way of doing this?

Pablo

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org 
For additional commands, e-mail: beginners-help@perl.org 
http://learn.perl.org/ 



Postbank Systems AG
Baunscheidtstraße 8
53113 Bonn

Sitz Bonn, Amtsgericht Bonn, HRB 8867

Vorstand: Klaar de Graaf, Vorsitzender
Manfred Löw, Dr. Thomas Mangel

Aufsichtsrat: Dr. Mario Daberkow, Vorsitzender
______________________________

Diese Nachricht ist nur für den vorgesehenen Empfänger bestimmt. Sollten Sie nicht \
der vorgesehene Empfänger dieser E-Mail und ihres Inhalts sein oder diese E-Mail \
irrtümlich erhalten haben, bitten wir Sie, den Absender unverzüglich darüber zu \
informieren und diese Nachricht und all ihre Anhänge vollständig von Ihrem Computer \
zu löschen. Jede Form der unbefugten Nutzung, Veröffentlichung, des Kopierens oder \
der Offenlegung des Inhalts dieser E-Mail ist nicht gestattet.

Bitte denken Sie über Ihre Verantwortung gegenüber der Umwelt nach, bevor Sie diese \
E-Mail ausdrucken.

This message is intended for the addressee only. If you are not the intended \
recipient of this e-mail message and its content or have received this e-mail in \
error, please notify the sender immediately and delete this message and all its \
attachments. Any form of unauthorized use, publication, copying or disclosure of the \
content of this e-mail is prohibited.

Please consider your environmental responsibility before printing this mail.



-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic