diff --git a/scripts/advanced.php b/scripts/advanced.php index 03e60e9..e4a88e2 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -245,6 +245,55 @@ if(isset($_GET['submit'])) { } } + if (isset($_GET["LogLevel_BirdnetRecordingService"])) { + $birdnet_recording_service_log_level = trim($_GET["LogLevel_BirdnetRecordingService"]); + + //Setting exists already, see if the value changed + if (strcmp($birdnet_recording_service_log_level, $config['LogLevel_BirdnetRecordingService']) !== 0) { + $contents = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents); + $contents2 = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents2); + $fh = fopen("/etc/birdnet/birdnet.conf", "w"); + $fh2 = fopen("./scripts/thisrun.txt", "w"); + fwrite($fh, $contents); + fwrite($fh2, $contents2); + sleep(1); + exec("sudo systemctl restart birdnet_recording.service"); + } + } + + if (isset($_GET["LogLevel_SpectrogramViewerService"])) { + $spectrogram_viewer_service_log_level = trim($_GET["LogLevel_SpectrogramViewerService"]); + + //Setting exists already, see if the value changed + if (strcmp($spectrogram_viewer_service_log_level, $config['LogLevel_SpectrogramViewerService']) !== 0) { + $contents = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents); + $contents2 = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents2); + $fh = fopen("/etc/birdnet/birdnet.conf", "w"); + $fh2 = fopen("./scripts/thisrun.txt", "w"); + fwrite($fh, $contents); + fwrite($fh2, $contents2); + sleep(1); + exec("sudo systemctl restart spectrogram_viewer.service"); + } + } + + if (isset($_GET["LogLevel_LiveAudioStreamService"])) { + $livestream_audio_service_log_level = trim($_GET["LogLevel_LiveAudioStreamService"]); + + //Setting exists already, see if the value changed + if (strcmp($livestream_audio_service_log_level, $config['LogLevel_LiveAudioStreamService']) !== 0) { + $contents = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents); + $contents2 = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents2); + $fh = fopen("/etc/birdnet/birdnet.conf", "w"); + $fh2 = fopen("./scripts/thisrun.txt", "w"); + fwrite($fh, $contents); + fwrite($fh2, $contents2); + sleep(1); + exec("sudo systemctl restart livestream.service && sudo systemctl restart icecast2.service"); + } + } + + $fh = fopen('/etc/birdnet/birdnet.conf', "w"); $fh2 = fopen("./scripts/thisrun.txt", "w"); fwrite($fh, $contents); @@ -505,7 +554,85 @@ foreach($formats as $format){


-

+ + + + + + + + + + + + + + + + + +
+

Logging

+
+

Note:

+ It is recommended that the Log Level be set to Error on production systems to keep output + manageable by only reporting errors. +
+ Not all components support the log level option at this time. +
+
Birdnet Recording: + +
Live Audio Stream: + +
Spectrogram Service: + +
+ + 'error' - Show all errors, including ones which can be recovered from. This is the default value.
+ 'warning' - Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
+ 'info' - Show informative messages and output during processing. This is in addition to warnings and errors.
+ 'debug' - Show everything, including debugging information.
+
+