Title: dockerflow.logging.JsonLogFormatter is weird about %s style logging · Issue #29 · mozilla-services/python-dockerflow · GitHub
Open Graph Title: dockerflow.logging.JsonLogFormatter is weird about %s style logging · Issue #29 · mozilla-services/python-dockerflow
X Title: dockerflow.logging.JsonLogFormatter is weird about %s style logging · Issue #29 · mozilla-services/python-dockerflow
Description: I have this config: # Logging LOGGING_USE_JSON = values.BooleanValue(True) LOGGING_DEFAULT_LEVEL = values.Value("INFO") @property def LOGGING(self): return { "version": 1, "disable_existing_loggers": False, "formatters": { "json": { "()"...
Open Graph Description: I have this config: # Logging LOGGING_USE_JSON = values.BooleanValue(True) LOGGING_DEFAULT_LEVEL = values.Value("INFO") @property def LOGGING(self): return { "version": 1, "disable_existing_loggers...
X Description: I have this config: # Logging LOGGING_USE_JSON = values.BooleanValue(True) LOGGING_DEFAULT_LEVEL = values.Value("INFO") @property def LOGGING(self): return { "version": 1, "...
Opengraph URL: https://github.com/mozilla-services/python-dockerflow/issues/29
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"dockerflow.logging.JsonLogFormatter is weird about %s style logging","articleBody":"I have this config:\r\n\r\n\r\n```python\r\n # Logging\r\n LOGGING_USE_JSON = values.BooleanValue(True)\r\n LOGGING_DEFAULT_LEVEL = values.Value(\"INFO\")\r\n\r\n @property\r\n def LOGGING(self):\r\n return {\r\n \"version\": 1,\r\n \"disable_existing_loggers\": False,\r\n \"formatters\": {\r\n \"json\": {\r\n \"()\": \"dockerflow.logging.JsonLogFormatter\",\r\n \"logger_name\": \"buildhub\",\r\n },\r\n \"verbose\": {\"format\": \"%(levelname)s %(asctime)s %(name)s %(message)s\"},\r\n },\r\n \"handlers\": {\r\n \"console\": {\r\n \"level\": self.LOGGING_DEFAULT_LEVEL,\r\n \"class\": \"logging.StreamHandler\",\r\n \"formatter\": (\"json\" if self.LOGGING_USE_JSON else \"verbose\"),\r\n },\r\n \"sentry\": {\r\n \"level\": \"ERROR\",\r\n \"class\": (\r\n \"raven.contrib.django.raven_compat.handlers\" \".SentryHandler\"\r\n ),\r\n },\r\n \"null\": {\"class\": \"logging.NullHandler\"},\r\n },\r\n \"root\": {\"level\": \"INFO\", \"handlers\": [\"sentry\", \"console\"]},\r\n\r\n...\r\n\r\n```\r\n\r\nWhen I do:\r\n\r\n```python\r\nIn [1]: import logging\r\n\r\nIn [2]: logger = logging.getLogger(\"myproject\")\r\n\r\nIn [3]: logger.info(\"Hi!\")\r\n{\"Timestamp\": 1541787363833421056, \"Type\": \"myproject\", \"Logger\": \"buildhub\", \"Hostname\": \"MacBook-Pro-131.local\", \"EnvVersion\": \"2.0\", \"Severity\": 6, \"Pid\": 68488, \"Fields\": {\"msg\": \"Hi!\"}}\r\n\r\nIn [4]: logger.info(\"Hi %s\", \"peter\")\r\n{\"Timestamp\": 1541787379742094080, \"Type\": \"myproject\", \"Logger\": \"buildhub\", \"Hostname\": \"MacBook-Pro-131.local\", \"EnvVersion\": \"2.0\", \"Severity\": 6, \"Pid\": 68488, \"Fields\": {\"msg\": \"Hi peter\"}}\r\n\r\nIn [5]: logger.info(\"Hi %s\", {'name': 'Peter'})\r\n{\"Timestamp\": 1541787416647823104, \"Type\": \"myproject\", \"Logger\": \"buildhub\", \"Hostname\": \"MacBook-Pro-131.local\", \"EnvVersion\": \"2.0\", \"Severity\": 6, \"Pid\": 68488, \"Fields\": {}}\r\n\r\n```\r\n\r\nNotice that when the param to `logger.debug(template, THIS)` isn't a string the final \"msg\" becomes empty (`\"Fields\": {}`). ","author":{"url":"https://github.com/peterbe","@type":"Person","name":"peterbe"},"datePublished":"2018-11-09T18:15:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/29/python-dockerflow/issues/29"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e2147def-76c6-5b33-11ef-8c0c4a57018b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB88:288F65:136BD06:1C2C530:6A54D70C |
| html-safe-nonce | c6d7eed727c57c2048b808f470aa5eceed63610746ac45c375d4eda219960e59 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjg4OjI4OEY2NToxMzZCRDA2OjFDMkM1MzA6NkE1NEQ3MEMiLCJ2aXNpdG9yX2lkIjoiNzU0NTQ0ODM4MTkwMjI4MDQ2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5f54e8aaaf5a97dffa6b633fce50fa4a13727f7889ab1fb41320102b1c66487 |
| hovercard-subject-tag | issue:379268281 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/mozilla-services/python-dockerflow/29/issue_layout |
| twitter:image | https://opengraph.githubassets.com/81c74e55e2960c2af6ddbd8c05f328f1174d4aea6e567593d42e9e11ab54b2cb/mozilla-services/python-dockerflow/issues/29 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/81c74e55e2960c2af6ddbd8c05f328f1174d4aea6e567593d42e9e11ab54b2cb/mozilla-services/python-dockerflow/issues/29 |
| og:image:alt | I have this config: # Logging LOGGING_USE_JSON = values.BooleanValue(True) LOGGING_DEFAULT_LEVEL = values.Value("INFO") @property def LOGGING(self): return { "version": 1, "disable_existing_loggers... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | peterbe |
| hostname | github.com |
| expected-hostname | github.com |
| None | a556215b071af6609619e2bbe6f00bdfbf0812ad723b1ae6c301858a7a829f54 |
| turbo-cache-control | no-preview |
| go-import | github.com/mozilla-services/python-dockerflow git https://github.com/mozilla-services/python-dockerflow.git |
| octolytics-dimension-user_id | 1066228 |
| octolytics-dimension-user_login | mozilla-services |
| octolytics-dimension-repository_id | 73705921 |
| octolytics-dimension-repository_nwo | mozilla-services/python-dockerflow |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 73705921 |
| octolytics-dimension-repository_network_root_nwo | mozilla-services/python-dockerflow |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 840b5d20d5a883c23cf56f5240b2c343d6cc0867 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width