>
> On 22 août, 13:27, Reinout van Rees <rein...@vanrees.org> wrote:
>>
>> Probably all your logging statements are executed right at file import
>> time before the logging is actually configured.
>
> Using the DictConfig in settings.py, the logger is configured before
> the apps models / views / whatever are imported.
>
> @Scott: Are you running the dev server ? If yes, the settings module
> should be imported "only" twice so you may import it directly (ie:
> "import settings") from your app. If yes, replace this with "from
> django.conf import settings", which is the right way to access the
> settings from an app.
>
@Reinout: Thanks, but yeah, already tried logging from a view function..
didn't work...
@Bruno: Yeah, I am using the dev server. I have been using from django.conf
import settings within my app to access settings..although unless I do
something like what Gelondia suggested... with the LOGGING =
settings.LOGGING, I'm not sure how the logging normally "invokes" the
settings. The way I see it, django magically loads the settings at some
point in the background, then when you use the logging, it accesses those
settings, and there's a certain time when these settings become accessible
so this works. But it's not working like this, so perhaps I'm mistaken. So
you're saying to replace all instances of "from django.conf import settings"
with just "import settings"? Or the other way around? Not sure about what
importing only twice does, and how importing settings more or less affects
this.
Thanks all for answering.
--
View this message in context: http://old.nabble.com/Django-1.3-logging-not-working-as-I%27d-expect-tp32299898p32349226.html
Sent from the django-users mailing list archive at Nabble.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment