Chinaunix

标题: 使用log4perl的问题。 [打印本页]

作者: shaneqi    时间: 2009-06-25 14:59
标题: 使用log4perl的问题。
hi,今天试用了一下mastering perl 里面log4perl的例子。

#!/usr/bin/perl

use strict;
use warnings;
use Log::Log4perl qw(:easy);

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

DEBUG ( "Hey?" );
ERROR  ("123" );

我理解DEBUG的信息,就是Hey?应该在屏幕中,为什么error.log里面也有呢?谢谢。
作者: yashiro_lj    时间: 2009-06-25 15:54
CPAN上关于easy mode的说明
For teaching purposes (especially for [1]), I've put :easy mode into Log::Log4perl, which just initializes a single root logger with a defined priority and a screen appender including some nice standard layout:





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2