0

im using the default django logger class.

import logging

This class logs django_session table content into file as well:

2013-09-19 01:37:55,818 DEBUG (0.003) UPDATE django_session SET session_data = 'NGNmYTgxNmZkZDA5YTAzNmUyOWI0ODUxOWVlOTUyMmQ2NDg0OWMyNjqAAn1xAShVCmFkbWluX3Vz\nZXJxAmNkamFuZ28uZGIubW9kZWxzLmJhc2UKbW9kZWxfdW5waWNrbGUKcQNjd3Rvb2xzMi5hcHBz\nLkFkbWluaXN0cmF0aW9uLm1vZGVscwpBZG1pbl91c2VyCnEEXWNkamFuZ28uZGIubW9kZWxzLmJh\nc2UKc2ltcGxlX2NsYXNzX2ZhY3RvcnkKcQWHUnEGfXEHKFUJZGF0ZV90aW1lcQhjZGF0ZXRpbWUK\nZGF0ZXRpbWUKcQlVCgfcCBsSDggAAACFUnEKaAJYFQAAAHNtdXN0YWZhQGRpbmNsb3VkLmNvbXEL\nVRJfYWRtaW5fZ3JvdXBfY2FjaGVxDGgDY3d0b29sczIuYXBwcy5BZG1pbmlzdHJhdGlvbi5tb2Rl\nbHMKQWRtaW5fZ3JvdXBzCnENXWgFh1JxDn1xDyhVBl9zdGF0ZXEQY2RqYW5nby5kYi5tb2RlbHMu\nYmFzZQpNb2RlbFN0YXRlCnERKYFxEn1xEyhVBmFkZGluZ3EUiVUCZGJxFVUHZGVmYXVsdHEWdWJV\nDmFkbWluX2dyb3VwX2lkcReKAQNVEGFkbWluX2dyb3V......

Is there a way to prevent this from logging ?

Please let me know if my question is not clear enough.

Thanks!

Kevin
  • 749
  • 2
  • 10
  • 27
  • possible duplicate of [How to stop sql logging in debug mode?](http://stackoverflow.com/questions/6867598/how-to-stop-sql-logging-in-debug-mode) – Kimvais Sep 20 '13 at 05:49

1 Answers1

1

Turn off your django.db.backend debug logging.

Or if it is just the django_session table you want to get rid of in the logs, use some other session backend than database.

Community
  • 1
  • 1
Kimvais
  • 38,306
  • 16
  • 108
  • 142
  • yes i just want to prevent django_session table content from logging into the logs. Sorry im new to django can you please explain a bit more how can i use come other sesion backend than database ? – Kevin Sep 20 '13 at 05:50
  • See the latter link in my answer, moreover https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-file-based-sessions – Kimvais Sep 20 '13 at 05:54
  • thnx for the links. I followed this link http://stackoverflow.com/questions/6867598/how-to-stop-sql-logging-in-debug-mode. Now the sql queires are not writing into the log file. Is there a way to only exclude django_session table query and write all others? – Kevin Sep 20 '13 at 06:22