Fixed #28810 -- Replaced '%' style logging formatting with str.format() style.
This commit is contained in:
parent
bf49d9eb0b
commit
3af305e8b8
|
@ -27,7 +27,8 @@ DEFAULT_LOGGING = {
|
||||||
'formatters': {
|
'formatters': {
|
||||||
'django.server': {
|
'django.server': {
|
||||||
'()': 'django.utils.log.ServerFormatter',
|
'()': 'django.utils.log.ServerFormatter',
|
||||||
'format': '[%(server_time)s] %(message)s',
|
'format': '[{server_time}] {message}',
|
||||||
|
'style': '{',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'handlers': {
|
'handlers': {
|
||||||
|
@ -190,4 +191,4 @@ class ServerFormatter(logging.Formatter):
|
||||||
return super().format(record)
|
return super().format(record)
|
||||||
|
|
||||||
def uses_server_time(self):
|
def uses_server_time(self):
|
||||||
return self._fmt.find('%(server_time)') >= 0
|
return self._fmt.find('{server_time}') >= 0
|
||||||
|
|
|
@ -299,10 +299,12 @@ Finally, here's an example of a fairly complex logging setup::
|
||||||
'disable_existing_loggers': False,
|
'disable_existing_loggers': False,
|
||||||
'formatters': {
|
'formatters': {
|
||||||
'verbose': {
|
'verbose': {
|
||||||
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
|
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
|
||||||
|
'style': '{',
|
||||||
},
|
},
|
||||||
'simple': {
|
'simple': {
|
||||||
'format': '%(levelname)s %(message)s'
|
'format': '{levelname} {message}',
|
||||||
|
'style': '{',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'filters': {
|
'filters': {
|
||||||
|
|
Loading…
Reference in New Issue