locked
ULS logs in WSS 3 - how do I change the date format? RRS feed

  • Question

  • How can I change the date format in the ULS logs (in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS)?

    We have four WSS 3 farms (three at SP1, one at SP2) and they all write dates in US format in the first column of the ULS logs. For example from today (8th December 2010):

    12/08/2010 12:32:19.42  OWSTIMER.EXE (0x0A88)                    0x0358 Windows SharePoint Services    E-Mail                         6871 Information The Incoming E-Mail service has completed a batch.  The elapsed time was 00:00:00.  The service processed 0 message(s) in total. 

    The web servers are all running Server 2003 SP2 with the Engligh (United Kingdom) locale (all dates in Windows Explorer etc appear in UK format). In all four farms the SPTrace service runs as the local system account.

    I have been searching the web for ages on this and have found no leads.

    Any help gratefully received.

    Thanks,

    SPV

    Wednesday, December 8, 2010 12:34 PM

All replies

  • did you try to change the time zone for Central Admin Web application. you can change from this way:

    Central Administration > Application Management > Web Application General Settings  and select the Central Admin Web app.

    in the time zone setting change to UK format, see if its worked.

     

    thanks

    -ws


    SharePoint administrator, MCTS,MCITP
    Wednesday, December 8, 2010 5:31 PM
  • Thanks for the prompt reply (I have configured my forum alerts now) and for the suggestion.

    I had forgotten about that setting for the Central Admin web app, but it is already set to the GMT timezone in all my farms.

    I have also already set the Admin Console site itself to the United Kingdom locale in all my farms (as the Site Settings for the admin console site don't show Regional Settings, I had to manually construct the URL http://{server}:{adminport}/_layouts/regionalsetng.aspx to get those settings).

    Friday, December 10, 2010 4:04 PM
  • The time in the ULS logs are set and pulled on seperate machines from the OS event log and not SharePoint based on your web app settings or Central Admin settings.  I've done many installs in London and hit this one all the time.   Here is the official reference to the ULS logs in SharePoint.  http://msdn.microsoft.com/en-us/library/ms916815  Fix the time on the server and you'll fix the logs time stamps.


    Kris Wagner, MVP, MCITP, MCTS Twitter @sharepointkris Blog: http://www.sharepointkris.com/blog
    • Marked as answer by Peng Lei Wednesday, December 29, 2010 2:55 AM
    • Unmarked as answer by spv_uk Wednesday, January 19, 2011 10:42 AM
    Saturday, December 11, 2010 6:53 AM
    Moderator
  • Kris,

    Thanks for the reply. I must admit though that I'm a bit confused by it. Do you mean that the ULS logs should automatically use the same date format as the OS? If so, that's not happening for me. The servers are already running in the UK locale (and always have been): Event Viewer, Explorer etc all show dates in the UK format. But when I open a ULS log in Notepad/Textpad, the dates are all written in US format.

    I'm not aware of Windows (or Sharepoint) being able to read the ULS logs natively so I use a third-party ULS reader. In particular I like the one from spsdev.com but it assumes the dates will be in the local (UK) format so it fails to render the file after the 12th of each month. Given the format of the date in the ULS files themselves, I consider this to be a problem with my Sharepoint farms, not the spsdev.com ULS reader.

    Sorry if I have misunderstood your reply.

    Thanks, Steve

    Monday, December 13, 2010 3:11 PM
  • Hi SPV_UK,

     

    maybe my question is stupid but still want to ask you :)..can you give me how the UK time look like? 

    Tuesday, December 14, 2010 2:55 AM
  • Hi SPV_UK,

     

    maybe my question is stupid but still want to ask you :)..can you give me how the UK time look like? 


    Hi MNHaizam,

    If you don't know the answer, then your question is not stupid. In fact it's the whole point of a question  :-)

    The UK date format is dd/mm/yyyy while the US date format is mm/dd/yyyy. Hence today (14th December 2010) is 14/12/2010 in UK format and 12/14/2010 in US format.

    I don't know how official this is, but Microsoft also use the 12-hour clock (e.g. 4:30pm) in the US format and the 24-hour clock in the UK format (e.g. 16:30).

    I hope that helps you.

    SPV_UK

    • Marked as answer by Peng Lei Wednesday, December 29, 2010 2:55 AM
    • Unmarked as answer by Peng Lei Wednesday, December 29, 2010 2:55 AM
    Tuesday, December 14, 2010 8:43 AM
  • SPV_UK

    Yeah..Thanks for that. Although I'm not yet testing this but would like to share the article which may apply to your situation as below.

    http://www.mike-tech.com/article.php?gif=iis&article=297

    • Marked as answer by Peng Lei Wednesday, December 29, 2010 2:55 AM
    • Unmarked as answer by spv_uk Wednesday, January 19, 2011 10:42 AM
    Wednesday, December 15, 2010 2:34 AM
  • MNHaizam

    Thanks for the link. For a moment I thought you'd cracked it, but it seems to be talking about the IIS logs that get written to the system32\LogFiles folder. The ULS logs I'm looking at are written to "Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS".

    But thanks for finding the article. It might give me some leads in other directions.

    Wednesday, December 15, 2010 8:32 AM
  • Hi SPV_UK, did you ever manage to resolve this? It sounded like Kris Wagner knew the answer!
    Thursday, January 5, 2012 11:57 AM
  • Hi sladefx.

    Unfortunately I didn't get any further with this. The link in Kris' reply talks about the usage logs (held under windir%\system32\LogFiles), not the ULS logs that I mentioned in my original post.

    As it turns out it should become moot for us - we are currently phasing out our WSS 3 installations, replacing with Sharepoint 2010 Enterprise (a long and tortuous process, especially as we are trying to introduce proper release management at the same time, but that's a different story).

    Cheers.

    Thursday, January 5, 2012 12:06 PM