⊗ppPsAuLg 66 of 84 menu

Logs During Parsing in PHP

When a parser runs for a long time, it is often unclear what it is currently doing, what is happening, or if it has hung. Therefore, I would recommend keeping logs.

Logs refer to records of all the parser's actions. For this, a separate table is usually created in the database, into which the parser will write all its actions: "visited such and such a page", "started parsing such and such a category". And so on - any actions of the parser.

Also write the time of adding the record to the table, as well as the record type: action, error, important action, etc. - this will make it easier to separate the important from the not so important.

Automatically clear the log table before a new parsing session:

TRUNCATE TABLE logs

Implement the described logging.

kaesfrruhi