Skip to content

web access log show utc time instead local time with timezone. #3853

Closed
@NewUserHa

Description

Long story short

in web_.log.py:

    def _format_t(request: BaseRequest,
                  response: StreamResponse,
                  time: float) -> str:
        now = datetime.datetime.utcnow()
        start_time = now - datetime.timedelta(seconds=time)
        return start_time.strftime('[%d/%b/%Y:%H:%M:%S +0000]')

the logged time is fixed and is a utc time, not a local time. there's not a easy way to setting it.

Expected behaviour

INFO:aiohttp.access:127.0.0.1 [18/Jun/2019:04:56:22 -8]

Actual behaviour

INFO:aiohttp.access:127.0.0.1 [18/Jun/2019:04:56:22 +0000]

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions