1

I need to run a lot of Django management commands in the crontab and want to log the output of each run to a special timestamped file. Is there a Django or Python module to help me do this or do I just have to roll my own?

3 Answers 3

3

You can use the Python logging package which is part of Python, see my answer to another question about elegant setup of logging in Django. You can inspect sys.argv to determine how you want to do logging, e.g. redirect to different files for different commands.

Sign up to request clarification or add additional context in comments.

Comments

2

Have a look at django-jogging. It's a breeze to set up all kinds of custom logging with it.

Comments

1

as of django 1.3 a better logging configuration approach is available. please check my answer to.. the same question pointed at by Vinay :-)

Elegant setup of Python logging in Django

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.