LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-25-2004, 06:58 PM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,618

Rep: Reputation: 48
how to get the time in the log ?


hi

in my perl script I use :

--------------------------------------------------------------------------------------------------
BEGIN
{
use CGI::Carp qw(carpout);
my $errorlog = "/home/test/logs/errorlog.txt";
open(LOG, ">$errorlog") or die("Unable to open $errorlog: $!\n");
print LOG "Errors:\n";
carpout(*LOG);
}

to write the log of ftp transfer

an get like:

Net::FTP: Net::FTP(2.65)
Net::FTP: Exporter(5.566)
Net::FTP: Net::Cmd(2.21)
Net::FTP: IO::Socket::INET(1.26)
Net::FTP: IO::Socket(1.27)
Net::FTP: IO::Handle(1.21)
Net::FTP=GLOB(0x83c9c1c)<<< 220 szhstorage Microsoft FTP Service (Version 5.0).
Net::FTP=GLOB(0x83c9c1c)>>> user anonymous
Net::FTP=GLOB(0x83c9c1c)<<< 331 Anonymous access allowed, send identity (e-mail name) as password.
Net::FTP=GLOB(0x83c9c1c)>>> PASS ....
Net::FTP=GLOB(0x83c9c1c)<<< 230 Anonymous user logged in.
Net::FTP=GLOB(0x83c9c1c)>>> PORT 192,168,0,1,131,37
Net::FTP=GLOB(0x83c9c1c)<<< 200 PORT command successful.
Net::FTP=GLOB(0x83c9c1c)>>> STOR SSA100
Net::FTP=GLOB(0x83c9c1c)<<< 150 Opening ASCII mode data connection for SSA100
Net::FTP=GLOB(0x83c9c1c)<<< 226 Transfer complete.
Net::FTP=GLOB(0x83c9c1c)>>> QUIT
Net::FTP=GLOB(0x83c9c1c)<<< 221

Errors:
--------------------------------------------------------------------------------------------------

but how to change it to get in the log the exact time
( date, hour and minutes ) for each line of ftp transfer ?

kind regards
cccc
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't log into SAMBA at first time xstefanox Linux - Networking 2 01-16-2006 05:41 AM
Can't log in the second time Gyope Slackware - Installation 9 06-21-2005 07:18 AM
Log reboot time? x5452 Linux - Software 2 03-30-2004 09:00 PM
Time Of Deletion Log? XAGXAGUL Linux - General 3 07-12-2003 11:24 AM
Can log files be time stamped? (such as FTP login and transfer log files) bripage Linux - Networking 6 08-08-2002 11:55 PM


All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration