Opened 7 years ago

Closed 7 years ago

#7036 closed defect (not a bug)

Logs include milliseconds unnecessarily

Reported by: joergent Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.3.22-rc
Severity: Keywords: log logging tor-client
Cc: opensource@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Sample:

Oct 03 22:57:57.000 [warn] Socks version 67 not recognized. (Tor is not an http proxy.)

Child Tickets

Change History (6)

comment:1 Changed 7 years ago by arma

Resolution: not a bug
Status: newclosed

it's a "feature"

see LogTimeGranularity in the man page

comment:2 Changed 7 years ago by nickm

Keywords: tor-client added
Milestone: Tor: unspecified
Resolution: not a bug
Status: closedreopened
Summary: Milliseconds of log time stamps is always zeroLogs include milliseconds unnecessarily

It's a feature, but there's a missing feature too: perhaps we should not emit the ".000" when we're logging with granularity of >= 1 second.

Then again, it might be a bad idea that would confuse anything parsing our logs.

comment:3 in reply to:  2 ; Changed 7 years ago by rransom

Replying to nickm:

It's a feature, but there's a missing feature too: perhaps we should not emit the ".000" when we're logging with granularity of >= 1 second.

If you want to step onto that slippery slope, perhaps Tor should omit the seconds field when logging with granularity >= 60 s, and (to be consistent) omit the minutes field when logging with granularity >= 3600 s.

comment:4 in reply to:  3 Changed 7 years ago by nickm

Replying to rransom:

If you want to step onto that slippery slope, perhaps Tor should omit the seconds field when logging with granularity >= 60 s, and (to be consistent) omit the minutes field when logging with granularity >= 3600 s.

Possibly, but I think the milliseconds offer the best benefit/cost, since "1 second" is the default granularity.

comment:5 in reply to:  2 Changed 7 years ago by arma

Replying to nickm:

It's a feature, but there's a missing feature too: perhaps we should not emit the ".000" when we're logging with granularity of >= 1 second.

Then again, it might be a bad idea that would confuse anything parsing our logs.

Seems like there's a real risk, and not a huge gain.

comment:6 Changed 7 years ago by nickm

Resolution: not a bug
Status: reopenedclosed

Yeah, I think that having a consistent parseable format is worth the extra bytes.

Note: See TracTickets for help on using tickets.