Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jun 25, 2010 1:16 am 
Offline
Senior Newbie

Joined: Tue Jun 22, 2010 11:26 pm
Posts: 15
Hey all,

I'm having some strange issues with how my Linode formats dates in some of my log files. I asked on IRC yesterday but nobody knew how to fix/change how its formatted.

This is how my logs show up now:

2010-06-23T18:26:01.634813-07:00 server crond[22277]: (root) CMD (/usr/local/some/process)
2010-06-23T18:27:01.662746-07:00 server crond[22282]: (root) CMD (/usr/local/some/process)
2010-06-23T18:28:01.692657-07:00 server crond[22345]: (root) CMD (/usr/local/some/process)
2010-06-23T18:29:01.714650-07:00 server crond[22371]: (root) CMD (/usr/local/some/process)

How do I get it to format like this?

Jun 23 18:23:01 server crond[24092]:(root) CMD (/usr/local/some/process)
Jun 23 18:24:01 server crond[26144]: (root) CMD (/usr/local/sbin/bfd -q)
Jun 23 18:24:01 server crond[26145]: (root) CMD (/usr/local/some/process)

The dates show up like this in /var/log/cron, /var/log/maillog, and /var/log/messages so I'm guessing it's got something to do with the OS. My apache logs show up fine and same with exim.

I'm running the CentOS 5.5 i386 image.

Any ideas?


Top
   
 Post subject:
PostPosted: Fri Jun 25, 2010 8:04 am 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
I _think_ it may be happening because you originally had LC_TIME unset or set to some weird ISO format, then changed it (or other way round,) and thus daemons started before the change use one, and rest the other. Check out your locale (no idea where it's set in CentOS), then well... try restarting services or reboot for a good measure.


Top
   
 Post subject:
PostPosted: Fri Jun 25, 2010 8:05 pm 
Offline
Senior Newbie

Joined: Tue Jun 22, 2010 11:26 pm
Posts: 15
Thanks, I tried changing my locale to en_US and C but when I rebooted my VPS it went back to POSIX.

I tried setting a i18n but that only made the console have the right locale.

Any more ideas or suggestions?


Top
   
 Post subject:
PostPosted: Sat Jun 26, 2010 12:15 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Try changing the settings in /etc/sysconfig/i18n.


Top
   
 Post subject:
PostPosted: Sat Jun 26, 2010 2:58 am 
Offline
Senior Newbie

Joined: Tue Jun 22, 2010 11:26 pm
Posts: 15
I set up i18n and rebooted but the logs still show up like that :(

cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"

locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

LC_TIME looks like its right there, could it have something to do with the kernel?


2010-06-25T23:57:01.756536-07:00 server crond[4652]: (root) CMD (/usr/local/sbin/bfd -q)
2010-06-25T23:57:01.757112-07:00 server crond[4653]: (root) CMD (/usr/local/directadmin/dataskq)
2010-06-25T23:58:01.939034-07:00 server crond[4740]: (root) CMD (/usr/local/directadmin/dataskq)


Top
   
 Post subject:
PostPosted: Sat Jun 26, 2010 10:35 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Hmm, did you maybe install an alternative syslog like syslog-ng or rsyslog? I think both of those have configurable time formats, which may default to the RFC 3339 format. You can check what's installed with
Code:
$ yum list installed '*log*'

The stock syslog daemon is sysklogd. If you have something else, look at its documentation to see how to change the timestamp format.


Top
   
 Post subject:
PostPosted: Sun Jun 27, 2010 4:56 am 
Offline
Senior Newbie

Joined: Tue Jun 22, 2010 11:26 pm
Posts: 15
Thanks so much for your help, it turns out the image had rsyslog installed.

I added this to my conf file to fix it:

$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

This shows up now though but I'm not sure if it's even harmful.

WARNING: rsyslogd is running in compatibility mode. Automatically generated config directives may interfer with your rsyslog.conf settings. We suggest upgrading your config and adding -c3 as the first rsyslogd option.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group