How to dump results and progress of a script in a log file

27 views
Skip to first unread message

Ram

unread,
May 6, 2020, 1:23:35 AM5/6/20
to django...@googlegroups.com
Hi,

We are running a script from our Django App's admin control and this script is going to

1. extract the data from XML feed or an API and insert the results into a db table
2. once the data is saved in a db table, the data will be presented in front app page
3. but we want to dump the output and errors from the script into a new log file so that it will help us to debug when there is a problem

Is there a way to achieve the 3rd item from the above list?

Thanks,
~Ram

Sherif Adigun

unread,
May 6, 2020, 4:22:04 AM5/6/20
to Django users
Django has the logging feature.

You definitely want to log success or errors in the second option while importing data into the database.

See Django logging system https://docs.djangoproject.com/en/3.0/topics/logging/

Reply all
Reply to author
Forward
0 new messages