#27687: Dateformat issue using django basic logging formatter
-------------------------------------+-------------------------------------
Reporter: Ahn ByungHyun | Owner: nobody
Type: Uncategorized | Status: closed
Component: Utilities | Version: 1.10
Severity: Normal | Resolution: invalid
Keywords: logging formatter | Triage Stage:
datefmt | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* status: new => closed
* resolution: => invalid
Old description:
> 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
> is not 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 intented behavior?
New description:
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?
--
Comment:
Hi, I don't think this has anything to do with Django -- it's just using
Python's logging module. Maybe this
[http://stackoverflow.com/questions/6290739/python-logging-use-
milliseconds-in-time-format Stackoverflow] question helps. For future
reference, please ask "is it a bug?" questions
[wiki:TicketClosingReasons/UseSupportChannels on our support channels]
rather than in the bug tracker. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/27687#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.03860fe323adb8f655f220f177327969%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.