加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

How can I install Log::Log4perl on Microsoft Windows?

发布时间:2020-12-15 20:52:26 所属栏目:大数据 来源:网络整理
导读:官方文档: http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can_I_install_Log::Log4perl_on_Microsoft_Windows? ? 摘录如下: ? How can I install Log::Log4perl on Microsoft Windows? Log::Log4perl is fully supported on the

官方文档: http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can_I_install_Log::Log4perl_on_Microsoft_Windows?

?

摘录如下:

?

How can I install Log::Log4perl on Microsoft Windows?

Log::Log4perl is fully supported on the Win32 platform. It has been tested with Activestate perl 5.6.1 under Windows 98 and rumor has it that it also runs smoothly on all other major flavors (Windows NT,2000,XP,etc.).

It also runs nicely with ActiveState 5.8.0,and,believe me,we had to jump through some major hoops for that.

Typically,Win32 systems don't have the make utility installed,so the standard perl Makefile.PL; make install on the downloadable distribution won't work. But don't despair,there's a very easy solution!

The Log::Log4perl homepage provides a so-called PPD file for ActiveState's ppm installer,which comes with ActiveState perl by default.

Install on ActiveState 5.6.*

The DOS command line

    ppm install "http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd
"

will contact the Log4perl homepage,download the latest Log::Log4perl distribution and install it. If your ActiveState installation lacks any of the modules Log::Log4perl depends upon,ppm will automatically contact ActivateState and download them from their CPAN-like repository.

Install on ActiveState 5.8.*

ActiveState's "Programmer's Package Manager" can be called from Window's Start Menu: Start->Programs->>ActiveState ActivePerl 5.8>Perl Package Manager will invoke ppm. Since Log::Log4perl hasn't made it yet into the standard ActiveState repository (and you probably don't want their outdated packages anyway),just tell ppm the first time you call it to add the Log4perl repository

    ppm> repository add http://log4perl.sourceforge.net/ppm

Then,just tell it to install Log::Log4perl and it will resolve all dependencies automatically and fetch them from log4perl.sourceforge.net if it can't find them in the main archives:

    ppm> install Log-Log4perl

That's it! Afterwards,just create a Perl script like

    use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($DEBUG);

my $logger = get_logger("Twix::Bar");
$logger->debug("Watch me!");

and run it. It should print something like

    2002/11/06 01:22:05 Watch me!

If you find that something doesn't work,please let us know at log4perl-devel@lists.sourceforge.net -- we'll apprechiate it. Have fun!

?

------------

我的安装经验:

运行->cmd出来的命令窗口

ppm install "http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd
"
--提示超时,试了好几次都一样。

ppm> repository add http://log4perl.sourceforge.net/ppm
--提示语法错误

ppm
--出来一个Perl Package Manager窗口,对于安装组件没有帮助,只能查看当前已经安装了哪些组件。

repository add http://log4perl.sourceforge.net/ppm
--没有该命令

------------
上面的尝试失败之后,直接访问http://log4perl.sourceforge.net/ppm ,发现可以下载相关的文件。 于是,下载Log-Log4perl.ppd 到D盘根目录,再到命令窗口执行: install Log-Log4perl.ppd --提示找不到Log-Log4perl.tar.gz 这就好办了,下载这个文件:Log-Log4perl.tar.gz到D盘,当然也可以是别的目录,跟Log-Log4perl.ppd在一个目录就行。 再到命令窗口运行: install Log-Log4perl.ppd 提示如下: D:/>ppm install Log-Log4perl.ppd Unpacking Log-Log4perl-1.31...done Generating HTML for Log-Log4perl-1.31...done Updating files in site area...done 至此,安装成功!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读