Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp in log is always Thu Jan 1 01:00:00 1970 #911

Open
OleLaursen opened this issue May 6, 2015 · 3 comments
Open

Timestamp in log is always Thu Jan 1 01:00:00 1970 #911

OleLaursen opened this issue May 6, 2015 · 3 comments
Labels

Comments

@OleLaursen
Copy link

I get log entries like this (log-date=true in the configuration) for a vassal:

[pid: 9789|app: 0|req: 82/234] 212.98.71.196 () {40 vars in 885 bytes} [Thu Jan 1 01:00:00 1970] GET /... => generated 229039 bytes in 180 msecs (HTTP/1.1 200) 6 headers in 209 bytes (3 switches on core 5)
[pid: 9789|app: 0|req: 83/235] 212.98.71.196 () {40 vars in 885 bytes} [Thu Jan 1 01:00:00 1970] GET /... => generated 1178484 bytes in 220 msecs (HTTP/1.1 200) 6 headers in 209 bytes (6 switches on core 6)
[pid: 9789|app: 0|req: 84/236] 157.55.39.5 () {40 vars in 578 bytes} [Thu Jan 1 01:00:00 1970] GET ... => generated 11830 bytes in 231 msecs (HTTP/1.1 404) 3 headers in 178 bytes (1 switches on core 2)

This is uwsgi 2.0.7 on Debian (kernel is 3.16.0-4-powerpc64) - it's a virtual machine running inside an IBM VIOS (AIX variant) which I suppose is a little bit odd, but everything else works fine, e.g. date returns the correct time, and similarly the nginx log has correct timestamps.

@unbit
Copy link
Owner

unbit commented May 6, 2015

I can only suppose some kind of ctime_r() misbehaviour.

Can you try building a formatted log string with the fields described here:

http://uwsgi-docs.readthedocs.org/en/latest/LogFormat.html

and report which works and which returns epoch 0 ?

For example i would expect %(ctime) to fail and %(ltime) to succeed

@OleLaursen
Copy link
Author

I tried ctime, ltime, epoch and time in one go:

ctime gives Thu Jan 1 01:00:00 1970
ltime gives 06/May/2015:12:04:17 +0200
epoch gives 1430906657
time gives 1430906657

By the way, looking at some logs from last year I can see that the timestamps were correct in uwsgi 1.2.3.

@unbit
Copy link
Owner

unbit commented May 6, 2015

iirc in 1.2 we used ctime (non thread-safe) then we moved to ctime_r, maybe the issue is here

@xrmx xrmx added the bug label Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants