LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-31-2007, 06:30 AM   #1
biiiep
Member
 
Registered: Aug 2003
Posts: 39

Rep: Reputation: 15
change timestamp for syslog


hallo,

i have a curious problem with timestamps in my logfile like syslog. it shows the seconds passed since... i think since 1. jan 1970. but i'd like to have it in a normal format, like date/daytime. but i didn't found a solution for this problem.

the red colored parts disturb me.

for example look at the dmesg output

Code:
[17189629.692000] end_request: I/O error, dev hdd, sector 504
[17189629.696000] hdd: tray open
[17189629.696000] end_request: I/O error, dev hdd, sector 508
and the syslog output

Code:
Mar 31 13:19:51 psymchn kernel: [17189629.692000] end_request: I/O error, dev hdd, sector 504
Mar 31 13:19:51 psymchn kernel: [17189629.696000] hdd: tray open
Mar 31 13:19:51 psymchn kernel: [17189629.696000] end_request: I/O error, dev hdd, sector 508
 
Old 03-31-2007, 08:38 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I'm not sure what that number is but I don't think it is a time stamp.

1) dmesg typically (unfortunately) has no time stamps in it. The messages there wrap around so that the most recent messages are at the end. Such messages could be as new as 1 second ago or as old as your last boot.

2) Your syslog actually has human readable time at the beginning of the lines so it wouldn't make sense you'd see that AND an epoch time later in the same syslog entry.

Oddly enough, however, the first part of the numbers does translate like a date in 1970:
epoch_converter.pl 17881629
Sun Jul 26 19:07:09 1970

However that date/time has no real significance.

Adding the second part of the number just moves it up to later in 1970 so I think it is just a coincidence that this number equated to sometime in 1970. The fact that there is more to the number suggests that it is not really.
 
  


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
How to change Debian log rotation of syslog and daemon.log onmountain Linux - Newbie 2 07-31-2008 02:27 AM
Change access.log timestamp,squid proxy gordonb Linux - Software 1 04-20-2006 12:28 AM
Router Logs sent to Syslog - Can I change the location Gnarg Linux - Networking 4 08-10-2004 09:24 AM
"Call Trace" messages, change syslog level? robe Linux - General 0 06-08-2004 10:05 AM
syslog timestamp skitzsofrenick Solaris / OpenSolaris 2 03-04-2004 10:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:35 PM.

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
Open Source Consulting | Domain Registration