Thursday, April 6, 2017

Re: ORM for structured Logs

On 6 April 2017 at 09:15, guettli <guettli76@gmail.com> wrote:
> Hello Brick Wall, how are you doing?

Hello Stonemason.

What is your question?

I do not have a strong opinion on your approach - i don't even know
the problem you are trying to solve.
or how big your logs are. a couple of KB per day or some GB per hour?

[the brickwall shrugs its shoulders]

>
> Am Dienstag, 4. April 2017 14:18:42 UTC+2 schrieb guettli:
>>
>> In the past I was told: Don't store logs in the database.
>>
>> Time (and hardware) has changed.
>>
>> I think it is time to store logs where I have great tools for analyzing
>> logs.
>>
>> Storing in a model which I can access via django orm is my current
>> strategy.
>>
>> It seems no one has done this before. I could not find such a project up
>> to now.
>>
>> My first draft looks like this:
>>
>>
>> class Log(models.Model):
>> datetime=models.DateTimeField(default=datetime.datetime.now,
>> db_index=True)
>> data=jsonfield.JSONField()
>> host=models.CharField(max_length=256, default='localhost',
>> db_index=True)
>> system=models.CharField(max_length=256, default='', db_index=True)
>>
>> I am missing two things:
>>
>> Missing1: Log level: INFO, WARN, ...
>>
>> Missing2: A way to store exceptions.
>>
>>
>> What do you think?
>>
>> What's wrong with this, what could be improved?
>>
>> Regards,
>> Thomas Güttler
>>
>>
>>
>>
>>
>>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c8742484-a252-4c05-939a-f7c3f2b4f505%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don't drive species to extinction

2) Don't destroy a habitat that species rely on.

3) Don't change the climate in ways that will result in the above.

}<(((*>

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABCjzWr3G%3DNnqkx75CEEXZ3bMXsV9Wd31A2vhMAxytjJREEBEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment