Thank you for the reply. But in my case i am seeing the date/time format in two different versions as below where the first line is what i want to be consistent. Not sure why am i seeing the second line as different compared to the first one.
Jan 14 18:29:39 test01 ldap-mail[2395]: test2
2013-01-14T18:29:39.320792+00:00 test01 ldap-mail[2395]: test3
OK,
it appears that the process that writes the lines with the test1 pattern
is using a different date format.
Check the environment of those processes and look for different locale settings.
If different users are used for starting those processes, check the initialization files in their home directories:
.profile, .bash_profile, for example. Look for variable names starting with LC_.
I've checked in user's home directory and i dont see any LC_ refrences in those files and then i have checked the same on the working system still it is the same file without LC_ references.
OK, but are you actually using different users for the processes that write test1
and test2? How do you start those processes? A shell script, compiled executable?
Try logging as those users and run:
As it is obviously always the same process logging (ldap-mail[2395]) and the logs have the same time stamp, would it be possible there's two syslog daemon processes running? Would make more sense to me, as the interface to syslog is binary afaik, formatting is done in syslogd. On the other hand, what about file locking?
Given the strings test[1-4], I suppose that the OP is testing the process execution of two processes with different locale settings.
You can log to syslog anything you want via the logger utility.
The PID is appended to the process name and is identical for all four entries shown above. You can freely log with logger, but your free style msg will be prepended with a (n internally generated?) time stamp and some system info.
On the other hand, were two syslog processes competing for input, I'd presume the behaviour would be what we see - each instance would get every other msg...
Actually the log is being written to the below location (i.e)
and the same log will be written into /var/log/messages where i see the alternate lines are kind of misleading (i.e) one line will show the format i would like to and the next following line will show the format as above log.