Files
clinicpro/migrations/Version20260629161536.php
hamed 803196108c feat(logging): Implement database logging with app_log table
- Created migration to set up app_log table for storing application logs.
- Added AppLog entity and repository for ORM handling of logs.
- Developed DbLogger service to persist logs of level WARNING and above to the database while maintaining existing logging behavior.
- Implemented tests for admin log retrieval and DbLogger functionality to ensure proper logging behavior.
- Enhanced logging context sanitization for better error tracking.
2026-06-29 20:01:03 +03:30

32 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260629161536 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create app_log table for persisted application logs';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE app_log (id INT AUTO_INCREMENT NOT NULL, level VARCHAR(16) NOT NULL, message LONGTEXT NOT NULL, context LONGTEXT DEFAULT NULL, channel VARCHAR(32) DEFAULT NULL, path VARCHAR(255) DEFAULT NULL, created_at INT NOT NULL, INDEX idx_app_log_level (level, created_at), INDEX idx_app_log_created (created_at), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE app_log');
}
}