LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-27-2014, 10:03 AM   #1
SteveInTallyFL
Member
 
Registered: May 2008
Location: Tallahassee, FL
Distribution: RHEL4, RHEL 5, OEL4, OEL5
Posts: 65

Rep: Reputation: 17
Apache Piped Logging Inaccurate strftime results


Apache 2.2.23.1-64 (Provided by SAS, Inc. as part of their middle tier server integration). Created a CustomLog entry in <VirtualHost> configuration for the access logging. Implemented piped logging (rotatelogs) and specified target name as "access_log.%Y-%m-%d-%H". Verified that the date and time on the system return accurate results. But when the logs are generated the %Y return 2015 instead of 2014, %m return 10 instead of 08, %d returns 21 instead of 27, and %H returns a wrong 2-digit hour of creation (and it is not the GMT -5 offset of our local time zone). I have no idea where to begin to troubleshoot this to get the functions to resolve the date/time correctly. Anyone have any suggestions?
 
Old 08-31-2014, 07:05 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
'man strftime' says it honours the TZ and LC_TIME environment variables. So maybe you could (example) turn
Code:
CustomLog "|/path/to/rotatelogs -l /var/logs/access_log.%Y-%m-%d-%H 86400" common
into
Code:
CustomLog "|/bin/env TZ=EDT /path/to/rotatelogs -l /var/logs/access_log.%Y-%m-%d-%H 86400" common
and see if forcing it that way works?
 
  


Reply

Tags
apache2conf, logging



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
Using en_GB.UTF-8 and strftime problems dive Linux - General 0 07-17-2013 03:45 AM
strftime akshay_satish Programming 1 11-26-2012 01:27 PM
Apache serving different results by browser wheel Linux - Server 1 10-05-2006 12:14 PM
Apache piped logs - split-logfile - zero size files alex_fittyfives Linux - Enterprise 0 08-26-2004 07:04 AM
strftime - 61 seconds?!?!?!? esnagel Linux - General 2 09-12-2002 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:19 AM.

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