Opened 7 years ago

Closed 7 years ago

#27687 closed Uncategorized (invalid)

Dateformat issue using django basic logging formatter

Reported by: Ahn ByungHyun Owned by: nobody
Component: Utilities Version: 1.10
Severity: Normal Keywords: logging formatter datefmt
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

I'm using django v1.10.4 with python 3.5.2 and write Logging setting in setting.py.

I faced some problem using log formatter.

I want to present date format of log like '%Y-%m-%d %H:%M:%S.%f%z' but %f doesn't work.

My formatters setting is like this.

'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
            'datefmt':'%Y-%m-%d %H:%M:%S.%f%z',
        },
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },

The log %(asctime)s is printed "2017-01-05 13:54:24.f+0900"

Is this bug? or intended behavior?

Change History (1)

comment:1 by Tim Graham, 7 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

Hi, I don't think this has anything to do with Django -- it's just using Python's logging module. Maybe this Stackoverflow question helps. For future reference, please ask "is it a bug?" questions on our support channels rather than in the bug tracker. Thanks!

Note: See TracTickets for help on using tickets.
Back to Top