How to install and use log4perl?
Asked Answered
A

2

15

I am new to using log4p and want to use the same for logging in my code. I am getting errors like:

Can't locate Log/Log4perl.pm in @INC

Which I understand is because of a missing library. Now, where and how do i get this library installed on my UNIX environment?

I tried installing:

yum install perl-Log-Log4perl-1.30-1.el6.noarch.rpm

This also failed. Am I not in the right track? Can someone give me a quick start up link which also tells how to install this package and from where?

Autrey answered 23/1, 2013 at 1:37 Comment(2)
Have you tried the cpan utility? cpan Log::Log4perl.Solstice
"This also failed" how? What happened?Diazomethane
B
28

The typical way to install packages for perl is to use cpan or its variations (cpanm, cpanp, etc). If it is packaged by your distro thats easier/faster, but if it is not, you would still be able to do it via cpan.

cpan Log::Log4perl

OR in a DOS command prompt enter

> cpan
> install Log::Log4perl

You can look up the packages you want and their exact package names at search.cpan.org

Check Wikipedia for information about CPAN

Bazar answered 23/1, 2013 at 1:40 Comment(3)
Thanks Karthik, what does "cpan" do hereAutrey
cpan is like yum but only for perl. It installs 3rd party packages. CPAN (in caps) is a collection of all 3rd party code that can be installed and used by programmers.Bazar
running this command , at the end it says: make has returned bad status , install seems impossibleSpectrochemistry
G
1
1) Go to http://search.cpan.org/~mschilli/Log-Log4perl-1.46/
2) Download tar.gz archive
3) tar zxfv archive
4) go to the archive's folder
5) run "perl Makefile.PL"
6) run "make"
7) run "make test"
8) run "make install"

that's all.

Galleon answered 7/12, 2015 at 21:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.