feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -4,13 +4,15 @@ declare(strict_types=1);
namespace Tests\Unit\Framework\Logging;
use App\Framework\Logging\ChannelLogger;
use App\Framework\Logging\DefaultLogger;
use App\Framework\Logging\HasChannel;
use App\Framework\Logging\LogChannel;
use App\Framework\Logging\LogHandler;
use App\Framework\Logging\Logger;
use App\Framework\Logging\LogLevel;
use App\Framework\Logging\LogRecord;
use App\Framework\Logging\ProcessorManager;
use App\Framework\Logging\ValueObjects\LogContext;
use PHPUnit\Framework\TestCase;
final class DefaultLoggerChannelTest extends TestCase
@@ -39,25 +41,28 @@ final class DefaultLoggerChannelTest extends TestCase
public function test_logger_has_all_channel_loggers(): void
{
expect($this->logger->security)->toBeInstanceOf(ChannelLogger::class);
expect($this->logger->cache)->toBeInstanceOf(ChannelLogger::class);
expect($this->logger->database)->toBeInstanceOf(ChannelLogger::class);
expect($this->logger->framework)->toBeInstanceOf(ChannelLogger::class);
expect($this->logger->error)->toBeInstanceOf(ChannelLogger::class);
$channelLogger = $this->logger->channel(LogChannel::SECURITY);
expect($channelLogger)->toBeInstanceOf(Logger::class);
expect($channelLogger)->toBeInstanceOf(HasChannel::class);
expect($this->logger->channel(LogChannel::CACHE))->toBeInstanceOf(Logger::class);
expect($this->logger->channel(LogChannel::DATABASE))->toBeInstanceOf(Logger::class);
expect($this->logger->channel(LogChannel::FRAMEWORK))->toBeInstanceOf(Logger::class);
expect($this->logger->channel(LogChannel::ERROR))->toBeInstanceOf(Logger::class);
}
public function test_channel_loggers_have_correct_channels(): void
{
expect($this->logger->security->getChannel())->toBe(LogChannel::SECURITY);
expect($this->logger->cache->getChannel())->toBe(LogChannel::CACHE);
expect($this->logger->database->getChannel())->toBe(LogChannel::DATABASE);
expect($this->logger->framework->getChannel())->toBe(LogChannel::FRAMEWORK);
expect($this->logger->error->getChannel())->toBe(LogChannel::ERROR);
expect($this->logger->channel(LogChannel::SECURITY)->channel)->toBe(LogChannel::SECURITY);
expect($this->logger->channel(LogChannel::CACHE)->channel)->toBe(LogChannel::CACHE);
expect($this->logger->channel(LogChannel::DATABASE)->channel)->toBe(LogChannel::DATABASE);
expect($this->logger->channel(LogChannel::FRAMEWORK)->channel)->toBe(LogChannel::FRAMEWORK);
expect($this->logger->channel(LogChannel::ERROR)->channel)->toBe(LogChannel::ERROR);
}
public function test_log_to_channel_creates_record_with_channel(): void
{
$this->logger->logToChannel(LogChannel::SECURITY, LogLevel::WARNING, 'Test message', ['key' => 'value']);
$this->logger->logToChannel(LogChannel::SECURITY, LogLevel::WARNING, 'Test message', LogContext::withData(['key' => 'value']));
expect($this->capturedRecords)->toHaveCount(1);
@@ -65,12 +70,12 @@ final class DefaultLoggerChannelTest extends TestCase
expect($record->getChannel())->toBe('security');
expect($record->getMessage())->toBe('Test message');
expect($record->getLevel())->toBe(LogLevel::WARNING);
expect($record->getContext())->toBe(['key' => 'value']);
expect($record->getContext())->toMatchArray(['key' => 'value']);
}
public function test_channel_logger_creates_records_with_correct_channel(): void
{
$this->logger->security->error('Security alert', ['ip' => '192.168.1.1']);
$this->logger->channel(LogChannel::SECURITY)->error('Security alert', LogContext::withData(['ip' => '192.168.1.1']));
expect($this->capturedRecords)->toHaveCount(1);
@@ -83,9 +88,9 @@ final class DefaultLoggerChannelTest extends TestCase
public function test_different_channels_create_different_records(): void
{
$this->logger->security->warning('Security warning');
$this->logger->cache->debug('Cache debug');
$this->logger->database->error('DB error');
$this->logger->channel(LogChannel::SECURITY)->warning('Security warning');
$this->logger->channel(LogChannel::CACHE)->debug('Cache debug');
$this->logger->channel(LogChannel::DATABASE)->error('DB error');
expect($this->capturedRecords)->toHaveCount(3);
@@ -139,9 +144,9 @@ final class DefaultLoggerChannelTest extends TestCase
{
// Mix aus Standard- und Channel-Logging
$this->logger->info('Standard info');
$this->logger->security->warning('Security warning');
$this->logger->channel(LogChannel::SECURITY)->warning('Security warning');
$this->logger->error('Standard error');
$this->logger->cache->debug('Cache debug');
$this->logger->channel(LogChannel::CACHE)->debug('Cache debug');
expect($this->capturedRecords)->toHaveCount(4);