Search Results

Search found 10 results on 1 pages for 'log4perl'.

Page 1/1 | 1 

  • Making self-logging modules with Log::Log4perl

    - by Oesor
    Is there a way to use Log::Log4perl to make a smart self-logging module that logs its operations to a file even in the absence of the calling script not initializing Log4perl? As far as I can tell from the documentation, the only way to use Log4perl is to initialize it in the running script from a configuration, then modules implementing Log4perl calls log themselves based on the caller's Log4perl config. Instead, I'd like the modules to provide a default initialization config for Log4perl. This would provide the default file appender for the module's category. Then, I could override this behavior by initing Log4perl in the caller with a different config if needed, and everything would hopefully just work. Is this sort of defensive logging behavior possible or am I going to need to rely on initing Log4perl in every .pl script that calls the module I want logged?

    Read the article

  • How do I make my Log::Log4perl logger work?

    - by Geo
    Here's the code I have: use strict; use warnings; use Log::Log4perl qw(:easy); Log::Log4perl->init({ level => $DEBUG }); my $logger = Log::Log4perl->get_logger("my.logger"); my $appender = Log::Log4perl::Appender->new("Log::Log4perl::Appender::File",filename => "my.file"); $appender->layout(Log::Log4perl::Layout::SimpleLayout->new); $logger->add_appender($appender); $logger->info("this is an info"); all I want to do is log a message to a file, and have the level show up. I understood that is what the SimpleLayout is for . I'd like to do this without a configuration file. Running the code above shows the following message: Log::Log4perl configuration looks suspicious: No loggers defined

    Read the article

  • Log4Perl - how to set exit code if any WARN, ERROR, or FATAL messages?

    - by pdxrlk
    Hi - I've been using Log4Perl extensively in a number of scripts. I'd like to augment those scripts to set an error code if any WARN or ERROR messages have been logged. I couldn't find any obvious way to do this based on existing documentation. I'd like to avoid a brute-force rewrite of my existing scripts to add a check on every WARN or ERROR log message; I'd prefer to handle it prior to script exit if possible like this pseudocode: if $log->has_warnings_or_errors then exit 1 else exit 0 Is there any easy way to call Log4Perl to determine if the current logger has issues messages of certain levels? Thanks.

    Read the article

  • Self logging modules without Moose

    - by stephenmm
    I have the same question as was asked here but unfortunately I cannot install Moose and I think the solution described there was particular to Moose. Can someone tell me how to the same in old school "use base" speak? To reiterate the question, I would like to have my base classes to have an automatic logging mechanism so if the user does not do anything I get some reasonable logging but if the user of my class needs/wants to overwrite it they can.

    Read the article

  • No package rrdtool-perl available

    - by Pentium10
    On a CentOS release 5.10 (Final) I am trying to install rrdtool to get RRDs.pm but I have no luck. yum install rrdtool-perl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * rpmforge: mirror.team-cymru.org Excluding Packages in global exclude list Finished Setting up Install Process No package rrdtool-perl available. Nothing to do I tried also librrds-perl but that was not found either. 2. I tried: yum whatprovides "*/RRDs.pm" Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * rpmforge: mirror.team-cymru.org Excluding Packages in global exclude list Finished cpanel-perl-514-Log-Log4perl-1.37-1.cp1136.x86_64 : CPAN module - Log4j implementation for Perl Repo : installed Matched from: Filename : /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Log/Log4perl/Appender/RRDs.pm cpanel-perl-514-RRDs-v1.4.7-1.cp1136.x86_64 : CPAN module - unknown Repo : installed Matched from: Filename : /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-64int/RRDs.pm then I tried installing but I got: No package cpanel-perl available and the variants (tried with full name, tried both repos listed)

    Read the article

  • Removing perl module installed with cpanm

    - by ZeC
    I am Perl beginner. I wanted to use Log::Log4perl module as I am familiar how it works in Java. I used cpanm script to download module, but I ran it without "sudo". Then it installed this module to my dir /home/amer/perl5. Afterwards, I installed it as sudoer, but I want to remove installation in my home dir to avoid any conflicts in future. How can I do that? Here is my cmdline execution stack. Thanks and Regards!

    Read the article

  • Munin on Centos 6 - missing perl MODULE_COMPAT_5.8.8

    - by André Bergonse
    I'm trying to install Munin on a new VPS through yum install munin but I keep getting an error about a missing perl module: Requires: perl(:MODULE_COMPAT_5.8.8). This is the perl version currently installed: v5.10.1. I've searched all around and still haven't found a solution for this. Here's the relevant part of the output of the installation attempt: --> Finished Dependency Resolution Error: Package: perl-Mail-Sender-0.8.13-2.el5.1.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-Log-Log4perl-1.13-2.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-Mail-Sendmail-0.79-9.el5.1.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-Log-Dispatch-FileRotate-1.16-1.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-Crypt-DES-2.05-3.el5.i386 (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: munin-1.4.7-5.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-IO-Multiplex-1.08-5.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: munin-common-1.4.7-5.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-Net-Server-0.96-2.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-Log-Dispatch-2.20-1.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: munin-1.4.7-5.el5.noarch (epel) Requires: bitstream-vera-fonts Error: Package: perl-Net-SNMP-5.2.0-1.el5.1.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-HTML-Template-2.9-1.el5.2.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: perl-IPC-Shareable-0.60-3.el5.noarch (epel) Requires: perl(:MODULE_COMPAT_5.8.8) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

    Read the article

  • Installing Munin on Centos 6

    - by justinhj
    I've hit problems installing munin on Centos 6. This seems to be a conflict between parts of Perl. I think the version of Perl is newer on Centos 6 (v5.10.1) When installing munin via yum I get errors relating to perl dependencies as below. I'm not a big enough whiz at yum or rpm to figure out the issue. Munin documentation does not yet talk about installing to Centos 6.0 Error: Package: munin-node-1.4.2-0.rpl1.el5.noarch (/munin-node-1.4.2-0.rpl1.el5.noarch) Requires: perl(Net::SNMP) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: bitstream-vera-fonts Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(HTML::Template) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl-Net-SNMP Error: Package: munin-common-1.4.2-0.rpl1.el5.noarch (/munin-common-1.4.2-0.rpl1.el5.noarch) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: munin-node-1.4.2-0.rpl1.el5.noarch (/munin-node-1.4.2-0.rpl1.el5.noarch) Requires: perl(DBI) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(Log::Log4perl) Error: Package: munin-node-1.4.2-0.rpl1.el5.noarch (/munin-node-1.4.2-0.rpl1.el5.noarch) Requires: perl(LWP::Simple) Error: Package: munin-node-1.4.2-0.rpl1.el5.noarch (/munin-node-1.4.2-0.rpl1.el5.noarch) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(RRDs) Error: Package: munin-node-1.4.2-0.rpl1.el5.noarch (/munin-node-1.4.2-0.rpl1.el5.noarch) Requires: perl-Net-Server Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(Date::Manip) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl-Net-Server Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(CGI::Fast) Error: Package: munin-1.4.2-0.rpl1.el5.noarch (/munin-1.4.2-0.rpl1.el5.noarch) Requires: perl(Time::HiRes)

    Read the article

  • installing lots of perl modules

    - by Colin Pickard
    Hi, I've been landed with the job of documenting how to install a very complicated application onto a clean server. Part of the application requires a lot of perl scripts, each of which seem to require lots of different perl modules. I don't know much about perl, and I only know one way to install the required modules. This means my documentation now looks this: Type each of these commands and accept all the defaults: sudo perl -MCPAN -e 'install JSON' sudo perl -MCPAN -e 'install Date::Simple' sudo perl -MCPAN -e 'install Log::Log4perl' sudo perl -MCPAN -e 'install Email::Simple' (.... continues for 2 more pages... ) Is there any way I can do all this one line like I can with aptitude i.e. Type the following command and go get a coffee: sudo aptitude install openssh-server libapache2-mod-perl2 build-essential ... Thank you (on behalf of the long suffering people who will be reading my document) EDIT: The best way to do this is to use the packaged versions. For the modules which were not packaged for Ubuntu 10.10 I ended up with a little perl script which I found here ) #!/usr/bin/perl -w use CPANPLUS; use strict; CPANPLUS::Backend->new( conf => { prereqs => 1 } )->install( modules => [ qw( Date::Simple File::Slurp LWP::Simple MIME::Base64 MIME::Parser MIME::QuotedPrint ) ] ); This means I can put a nice one liner in my document: sudo perl installmodules.pl

    Read the article

1