Re: Best approach for audit logging in Django.

2022-06-09 Thread Sencer Hamarat
Hi, Mukul

Never use a disk file for audit logging.
Use at least a DB. On the other hand, using logging facilities or
specialized tools are better options.
Jason's suggestion above might lead you to the right choice.

Kind Regards,
Sencer HAMARAT



On Mon, Jun 6, 2022 at 7:59 AM Mukul Verma  wrote:

> i also have the question regarding this, is that i have to create auditing
> log file for all the activities performing in the project smallest or
> biggest may you please tell how to initiate this task from beginning.
>
> *Thanks*
> *Mukul Verma*
>
> On Friday, 3 June 2022 at 23:32:04 UTC+5:30 sutharl...@gmail.com wrote:
>
>> Hi Sencer, signals will be helpful only if you are auditing on certain
>> models
>> but if you are trying to audit a set of views then middleware will be a
>> better choice since that will be more manageable
>>
>> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>>
>>> one good source when you have a question "is there anything in django
>>> that does X?" is to go to djangopackages.org.
>>>
>>> https://djangopackages.org/grids/g/model-audit/, for example, is a list
>>> of packages for model auditing and history
>>>
>>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>>
 Hi,

 I've been planning to add audit logging to the project.

 But, I can not decide which approach is the best;
 Using signals or creating middleware?

 Project needs to being log events on change of model object with these
 informations below:

 - If a record is inserted, updated and deleted:
- who is taking this action (ForeignKey)
- what is the action (Choice)
- which applications model object affected (ContentType)
- affected object (Generic relation)
- current data in json format
- previous data in json format


 Kind regards,
 Sencer HAMARAT

 --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/415a6eee-74b2-4cbf-b708-2ff15091aeecn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACp8TZgkRvadptOq41jhAUbyw4r9KWjLf%3D%3D3vC1BDAuXk_POsQ%40mail.gmail.com.


Re: Best approach for audit logging in Django.

2022-06-09 Thread Sencer Hamarat
Hi Lalit,

Thanks for your reply.

Actually, It must cover all models. Not certain ones.
I thought middleware should be a much better place for this action, but I
can't imagine how to handle it.

Saygılarımla,
Sencer HAMARAT



On Fri, Jun 3, 2022 at 9:01 PM Lalit Suthar 
wrote:

> Hi Sencer, signals will be helpful only if you are auditing on certain
> models
> but if you are trying to audit a set of views then middleware will be a
> better choice since that will be more manageable
>
> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>
>> one good source when you have a question "is there anything in django
>> that does X?" is to go to djangopackages.org.
>>
>> https://djangopackages.org/grids/g/model-audit/, for example, is a list
>> of packages for model auditing and history
>>
>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I've been planning to add audit logging to the project.
>>>
>>> But, I can not decide which approach is the best;
>>> Using signals or creating middleware?
>>>
>>> Project needs to being log events on change of model object with these
>>> informations below:
>>>
>>> - If a record is inserted, updated and deleted:
>>>- who is taking this action (ForeignKey)
>>>- what is the action (Choice)
>>>- which applications model object affected (ContentType)
>>>- affected object (Generic relation)
>>>- current data in json format
>>>- previous data in json format
>>>
>>>
>>> Kind regards,
>>> Sencer HAMARAT
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGp2JVGgoO0jdVSbWHtwPtdeXuD6PuUMxVd3p2EY_QZz6CedCA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACp8TZgA1%2BPAPw8TSkv3JJJMHHETfq729zzsNbgFsoKtWL2ZgA%40mail.gmail.com.


Re: Best approach for audit logging in Django.

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
Based on my experience, this is the easiest one to start with:

https://django-auditlog.readthedocs.io/

On Mon, 6 Jun 2022 at 12:58, Mukul Verma  wrote:

> i also have the question regarding this, is that i have to create auditing
> log file for all the activities performing in the project smallest or
> biggest may you please tell how to initiate this task from beginning.
>
> *Thanks*
> *Mukul Verma*
>
> On Friday, 3 June 2022 at 23:32:04 UTC+5:30 sutharl...@gmail.com wrote:
>
>> Hi Sencer, signals will be helpful only if you are auditing on certain
>> models
>> but if you are trying to audit a set of views then middleware will be a
>> better choice since that will be more manageable
>>
>> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>>
>>> one good source when you have a question "is there anything in django
>>> that does X?" is to go to djangopackages.org.
>>>
>>> https://djangopackages.org/grids/g/model-audit/, for example, is a list
>>> of packages for model auditing and history
>>>
>>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>>
 Hi,

 I've been planning to add audit logging to the project.

 But, I can not decide which approach is the best;
 Using signals or creating middleware?

 Project needs to being log events on change of model object with these
 informations below:

 - If a record is inserted, updated and deleted:
- who is taking this action (ForeignKey)
- what is the action (Choice)
- which applications model object affected (ContentType)
- affected object (Generic relation)
- current data in json format
- previous data in json format


 Kind regards,
 Sencer HAMARAT

 --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/415a6eee-74b2-4cbf-b708-2ff15091aeecn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKhtoTh3NPBa2BO%2BJ7FMZJf5zUg628K8AFDrEk5GNnkVkDszw%40mail.gmail.com.


Re: Best approach for audit logging in Django.

2022-06-05 Thread Mukul Verma
i also have the question regarding this, is that i have to create auditing 
log file for all the activities performing in the project smallest or 
biggest may you please tell how to initiate this task from beginning.

*Thanks*
*Mukul Verma*

On Friday, 3 June 2022 at 23:32:04 UTC+5:30 sutharl...@gmail.com wrote:

> Hi Sencer, signals will be helpful only if you are auditing on certain 
> models 
> but if you are trying to audit a set of views then middleware will be a 
> better choice since that will be more manageable
>
> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>
>> one good source when you have a question "is there anything in django 
>> that does X?" is to go to djangopackages.org.
>>
>> https://djangopackages.org/grids/g/model-audit/, for example, is a list 
>> of packages for model auditing and history
>>
>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I've been planning to add audit logging to the project.
>>>
>>> But, I can not decide which approach is the best;
>>> Using signals or creating middleware?
>>>
>>> Project needs to being log events on change of model object with these 
>>> informations below:
>>>
>>> - If a record is inserted, updated and deleted:
>>>- who is taking this action (ForeignKey)
>>>- what is the action (Choice)
>>>- which applications model object affected (ContentType)
>>>- affected object (Generic relation)
>>>- current data in json format
>>>- previous data in json format
>>>
>>>
>>> Kind regards,
>>> Sencer HAMARAT
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/415a6eee-74b2-4cbf-b708-2ff15091aeecn%40googlegroups.com.


Re: Best approach for audit logging in Django.

2022-06-03 Thread Lalit Suthar
Hi Sencer, signals will be helpful only if you are auditing on certain
models
but if you are trying to audit a set of views then middleware will be a
better choice since that will be more manageable

On Fri, 3 Jun 2022 at 18:29, Jason  wrote:

> one good source when you have a question "is there anything in django that
> does X?" is to go to djangopackages.org.
>
> https://djangopackages.org/grids/g/model-audit/, for example, is a list
> of packages for model auditing and history
>
> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>
>> Hi,
>>
>> I've been planning to add audit logging to the project.
>>
>> But, I can not decide which approach is the best;
>> Using signals or creating middleware?
>>
>> Project needs to being log events on change of model object with these
>> informations below:
>>
>> - If a record is inserted, updated and deleted:
>>- who is taking this action (ForeignKey)
>>- what is the action (Choice)
>>- which applications model object affected (ContentType)
>>- affected object (Generic relation)
>>- current data in json format
>>- previous data in json format
>>
>>
>> Kind regards,
>> Sencer HAMARAT
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVGgoO0jdVSbWHtwPtdeXuD6PuUMxVd3p2EY_QZz6CedCA%40mail.gmail.com.


Re: Best approach for audit logging in Django.

2022-06-03 Thread Jason
one good source when you have a question "is there anything in django that 
does X?" is to go to djangopackages.org.

https://djangopackages.org/grids/g/model-audit/, for example, is a list of 
packages for model auditing and history

On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:

> Hi,
>
> I've been planning to add audit logging to the project.
>
> But, I can not decide which approach is the best;
> Using signals or creating middleware?
>
> Project needs to being log events on change of model object with these 
> informations below:
>
> - If a record is inserted, updated and deleted:
>- who is taking this action (ForeignKey)
>- what is the action (Choice)
>- which applications model object affected (ContentType)
>- affected object (Generic relation)
>- current data in json format
>- previous data in json format
>
>
> Kind regards,
> Sencer HAMARAT
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com.


Best approach for audit logging in Django.

2022-06-03 Thread Sencer Hamarat
Hi,

I've been planning to add audit logging to the project.

But, I can not decide which approach is the best;
Using signals or creating middleware?

Project needs to being log events on change of model object with these
informations below:

- If a record is inserted, updated and deleted:
   - who is taking this action (ForeignKey)
   - what is the action (Choice)
   - which applications model object affected (ContentType)
   - affected object (Generic relation)
   - current data in json format
   - previous data in json format


Kind regards,
Sencer HAMARAT

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACp8TZg%2B5ChDFW4AEv6nYuzFJ4Vv%3DqjydWBubfXzO8Z2XeirAw%40mail.gmail.com.