journalisation en erreur

This commit is contained in:
2026-03-17 08:08:02 +01:00
parent 3b05390ec4
commit 6541cefea0
3 changed files with 36 additions and 24 deletions

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Pont de logging pour scripts Bash
*/
require_once __DIR__ . '/../lib/monitoring-lib.php';
if ($argc < 4) {
fwrite(STDERR, "Usage: log-cli.php <LEVEL> <EVENT> <MESSAGE> [CONTEXT...]\n");
exit(1);
}
$level = strtoupper($argv[1]);
$event = $argv[2];
$message = $argv[3];
$context = [];
// On récupère les arguments restants comme contexte
for ($i = 4; $i < $argc; $i++) {
$context[] = $argv[$i];
}
log_event($level, $event, $message, $context);