top | item 37046891

(no title)

eyko | 2 years ago

If you're going to treat logs as a db entry and afford them a schema, then by all means knock yourself out.

The main point he's trying to make is not just about the logs you wrote but about logs coming from other systems or services, e.g. monitoring kernel logs in your OS. As he rightly points out, one of the reasons is that logs are not an API.

> One reason this happens is that almost no one considers log messages to be an API, and so they feel free to change log messages at whim.

discuss

order

gabereiser|2 years ago

   create table log (dt timestamp not null primary key, msg text not null)
is usually all you need to start sifting through the haystack. Problem with this approach is if you aren't diligent, you'll end up killing you app AND you're db.

sgarland|2 years ago

You can’t use log timestamps as a PK; you’ll run into non-unique entries nearly immediately.