Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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


in my perl script I use :

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";

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


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


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 04:41 AM
Can't log in the second time Gyope Slackware - Installation 9 06-21-2005 06:18 AM
Log reboot time? x5452 Linux - Software 2 03-30-2004 08:00 PM
Time Of Deletion Log? XAGXAGUL Linux - General 3 07-12-2003 10:24 AM
Can log files be time stamped? (such as FTP login and transfer log files) bripage Linux - Networking 6 08-08-2002 10:55 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:40 AM.

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