|
PACS System 0.1.0
PACS DICOM system library
|
Adapter for DICOM audit logging using logger_system. More...
#include <logger_adapter.h>

Classes | |
| class | impl |
Static Public Member Functions | |
| static void | initialize (const logger_config &config) |
| Initialize the logger with configuration. | |
| static void | shutdown () |
| Shutdown the logger. | |
| static auto | is_initialized () noexcept -> bool |
| Check if the logger is initialized. | |
| template<typename... Args> | |
| static void | trace (kcenon::pacs::compat::format_string< Args... > fmt, Args &&... args) |
| Log a trace-level message. | |
| template<typename... Args> | |
| static void | debug (kcenon::pacs::compat::format_string< Args... > fmt, Args &&... args) |
| Log a debug-level message. | |
| template<typename... Args> | |
| static void | info (kcenon::pacs::compat::format_string< Args... > fmt, Args &&... args) |
| Log an info-level message. | |
| template<typename... Args> | |
| static void | warn (kcenon::pacs::compat::format_string< Args... > fmt, Args &&... args) |
| Log a warning-level message. | |
| template<typename... Args> | |
| static void | error (kcenon::pacs::compat::format_string< Args... > fmt, Args &&... args) |
| Log an error-level message. | |
| template<typename... Args> | |
| static void | fatal (kcenon::pacs::compat::format_string< Args... > fmt, Args &&... args) |
| Log a fatal-level message. | |
| static void | log (log_level level, const std::string &message) |
| Log a message at the specified level. | |
| static auto | is_level_enabled (log_level level) noexcept -> bool |
| Check if a log level is enabled. | |
| static void | flush () |
| Flush all pending log messages. | |
| static void | log_association_established (const std::string &calling_ae, const std::string &called_ae, const std::string &remote_ip) |
| Log DICOM association establishment. | |
| static void | log_association_released (const std::string &calling_ae, const std::string &called_ae) |
| Log DICOM association release. | |
| static void | log_c_store_received (const std::string &calling_ae, const std::string &patient_id, const std::string &study_uid, const std::string &sop_instance_uid, storage_status status) |
| Log C-STORE operation. | |
| static void | log_c_find_executed (const std::string &calling_ae, query_level level, std::size_t matches_returned) |
| Log C-FIND operation. | |
| static void | log_c_move_executed (const std::string &calling_ae, const std::string &destination_ae, const std::string &study_uid, std::size_t instances_moved, move_status status) |
| Log C-MOVE operation. | |
| static void | log_security_event (security_event_type type, const std::string &description, const std::string &user_id="") |
| Log a security-related event. | |
| static void | set_min_level (log_level level) |
| Set the minimum log level. | |
| static auto | get_min_level () noexcept -> log_level |
| Get the current minimum log level. | |
| static auto | get_config () -> const logger_config & |
| Get the current configuration. | |
Static Private Member Functions | |
| static void | write_audit_log (const std::string &event_type, const std::string &outcome, const std::map< std::string, std::string > &fields) |
| static auto | storage_status_to_string (storage_status status) -> std::string |
| static auto | move_status_to_string (move_status status) -> std::string |
| static auto | query_level_to_string (query_level level) -> std::string |
| static auto | security_event_to_string (security_event_type type) -> std::string |
| static auto | log_level_to_string (log_level level) -> std::string |
Static Private Attributes | |
| static std::unique_ptr< impl > | pimpl_ = nullptr |
Adapter for DICOM audit logging using logger_system.
This class provides a unified interface for logging in the PACS system, including:
The adapter uses logger_system's high-performance async logging (4.34M msg/s) internally while providing a PACS-specific API.
Thread Safety: All methods are thread-safe.
Definition at line 184 of file logger_adapter.h.
|
inlinestatic |
Log a debug-level message.
| Args | Format argument types |
| fmt | Format string (std::format syntax) |
| args | Format arguments |
Definition at line 237 of file logger_adapter.h.
References kcenon::pacs::integration::debug, and log().
Referenced by kcenon::pacs::workflow::task_scheduler::create_archive_callback(), kcenon::pacs::workflow::task_scheduler::create_cleanup_callback(), kcenon::pacs::workflow::task_scheduler::create_verification_callback(), http_client::del(), kcenon::pacs::workflow::task_scheduler::execute_task(), http_client::get(), kcenon::pacs::workflow::task_scheduler::load_tasks(), kcenon::pacs::workflow::auto_prefetch_service::on_worklist_query(), http_client::post(), kcenon::pacs::workflow::auto_prefetch_service::prefetch_study(), kcenon::pacs::workflow::auto_prefetch_service::process_request(), kcenon::pacs::workflow::auto_prefetch_service::query_prior_studies(), kcenon::pacs::workflow::auto_prefetch_service::run_loop(), kcenon::pacs::workflow::task_scheduler::run_loop(), and kcenon::pacs::workflow::task_scheduler::save_tasks().


|
inlinestatic |
Log an error-level message.
| Args | Format argument types |
| fmt | Format string (std::format syntax) |
| args | Format arguments |
Definition at line 270 of file logger_adapter.h.
References kcenon::pacs::integration::error, and log().
Referenced by kcenon::pacs::workflow::task_scheduler::create_archive_callback(), kcenon::pacs::workflow::task_scheduler::create_cleanup_callback(), kcenon::pacs::workflow::task_scheduler::create_verification_callback(), kcenon::pacs::workflow::task_scheduler::execute_task(), kcenon::pacs::workflow::task_scheduler::load_tasks(), kcenon::pacs::workflow::auto_prefetch_service::prefetch_study(), kcenon::pacs::workflow::auto_prefetch_service::query_prior_studies(), ai_service_connector::impl::request_inference(), and kcenon::pacs::workflow::task_scheduler::save_tasks().


|
inlinestatic |
Log a fatal-level message.
| Args | Format argument types |
| fmt | Format string (std::format syntax) |
| args | Format arguments |
Definition at line 281 of file logger_adapter.h.
References kcenon::pacs::integration::fatal, and log().

|
static |
|
staticnodiscard |
Get the current configuration.
Definition at line 346 of file logger_adapter.cpp.
|
staticnodiscardnoexcept |
Get the current minimum log level.
Definition at line 344 of file logger_adapter.cpp.
References kcenon::pacs::integration::off.
|
inlinestatic |
Log an info-level message.
| Args | Format argument types |
| fmt | Format string (std::format syntax) |
| args | Format arguments |
Definition at line 248 of file logger_adapter.h.
References kcenon::pacs::integration::info, and log().
Referenced by ai_service_connector::impl::cancel(), kcenon::pacs::workflow::task_scheduler::cancel_task(), kcenon::pacs::workflow::task_scheduler::create_archive_callback(), kcenon::pacs::workflow::task_scheduler::create_cleanup_callback(), kcenon::pacs::workflow::task_scheduler::create_verification_callback(), kcenon::pacs::workflow::auto_prefetch_service::execute_cycle(), kcenon::pacs::workflow::task_scheduler::execute_cycle(), kcenon::pacs::workflow::task_scheduler::execute_task(), ai_service_connector::impl::initialize(), kcenon::pacs::workflow::task_scheduler::load_tasks(), kcenon::pacs::workflow::task_scheduler::pause_task(), kcenon::pacs::workflow::auto_prefetch_service::prefetch_study(), ai_service_connector::impl::request_inference(), kcenon::pacs::workflow::task_scheduler::resume_task(), kcenon::pacs::workflow::task_scheduler::schedule(), ai_service_connector::impl::shutdown(), kcenon::pacs::workflow::auto_prefetch_service::start(), kcenon::pacs::workflow::task_scheduler::start(), kcenon::pacs::workflow::auto_prefetch_service::stop(), kcenon::pacs::workflow::task_scheduler::stop(), kcenon::pacs::workflow::task_scheduler::trigger_task(), ai_service_connector::impl::update_credentials(), and kcenon::pacs::workflow::task_scheduler::update_schedule().


|
static |
Initialize the logger with configuration.
Must be called before any logging operations. Sets up console and file writers, configures log levels, and initializes the audit logger if enabled.
| config | Configuration options |
Definition at line 337 of file logger_adapter.cpp.
|
staticnodiscardnoexcept |
Check if the logger is initialized.
Definition at line 339 of file logger_adapter.cpp.
|
staticnodiscardnoexcept |
Check if a log level is enabled.
| level | The level to check |
Definition at line 341 of file logger_adapter.cpp.
Referenced by kcenon::pacs::di::LoggerService::is_enabled().

|
static |
Log a message at the specified level.
| level | Log severity level |
| message | The message to log |
Definition at line 340 of file logger_adapter.cpp.
Referenced by kcenon::pacs::di::LoggerService::debug(), debug(), kcenon::pacs::di::LoggerService::error(), error(), kcenon::pacs::di::LoggerService::fatal(), fatal(), kcenon::pacs::di::LoggerService::info(), info(), kcenon::pacs::di::LoggerService::trace(), trace(), kcenon::pacs::di::LoggerService::warn(), and warn().

|
static |
Log DICOM association establishment.
Records when a remote system connects and establishes a DICOM association.
| calling_ae | AE title of the remote system |
| called_ae | AE title of this system |
| remote_ip | IP address of the remote system |
Definition at line 362 of file logger_adapter.cpp.
References kcenon::pacs::integration::info, and write_audit_log().

|
static |
Log DICOM association release.
Records when a DICOM association is gracefully released.
| calling_ae | AE title of the remote system |
| called_ae | AE title of this system |
Definition at line 374 of file logger_adapter.cpp.
References kcenon::pacs::integration::debug, and write_audit_log().

|
static |
Log C-FIND operation.
Records when a query is executed against the PACS database.
| calling_ae | AE title of the querying system |
| level | Query retrieve level (patient, study, series, image) |
| matches_returned | Number of matching records returned |
Definition at line 406 of file logger_adapter.cpp.
References kcenon::pacs::integration::debug, query_level_to_string(), and write_audit_log().

|
static |
Log C-MOVE operation.
Records when images are transferred to another system.
| calling_ae | AE title requesting the move |
| destination_ae | AE title of the destination |
| study_uid | Study Instance UID being moved |
| instances_moved | Number of instances successfully moved |
| status | Status of the move operation |
Definition at line 420 of file logger_adapter.cpp.
References kcenon::pacs::integration::info, move_status_to_string(), kcenon::pacs::integration::partial_success, kcenon::pacs::integration::success, kcenon::pacs::integration::warn, and write_audit_log().

|
static |
Log C-STORE operation.
Records when a DICOM object is received via C-STORE. This is critical for HIPAA audit trail requirements.
| calling_ae | AE title of the sender |
| patient_id | Patient ID from the received object |
| study_uid | Study Instance UID |
| sop_instance_uid | SOP Instance UID of the stored object |
| status | Status of the storage operation |
Definition at line 382 of file logger_adapter.cpp.
References kcenon::pacs::integration::info, storage_status_to_string(), kcenon::pacs::integration::success, kcenon::pacs::integration::warn, and write_audit_log().

|
staticnodiscardprivate |
Definition at line 563 of file logger_adapter.cpp.
References kcenon::pacs::integration::debug, kcenon::pacs::integration::error, kcenon::pacs::integration::fatal, kcenon::pacs::integration::info, kcenon::pacs::integration::off, kcenon::pacs::integration::trace, and kcenon::pacs::integration::warn.
|
static |
Log a security-related event.
Records security events for audit and intrusion detection.
| type | Type of security event |
| description | Human-readable description |
| user_id | Optional user or system identifier |
Definition at line 447 of file logger_adapter.cpp.
References kcenon::pacs::integration::access_denied, kcenon::pacs::integration::association_rejected, kcenon::pacs::integration::authentication_failure, kcenon::pacs::integration::authentication_success, kcenon::pacs::integration::configuration_change, kcenon::pacs::integration::data_export, kcenon::pacs::integration::info, kcenon::pacs::integration::invalid_request, security_event_to_string(), kcenon::pacs::integration::warn, and write_audit_log().

|
staticnodiscardprivate |
Definition at line 505 of file logger_adapter.cpp.
References kcenon::pacs::integration::cancelled, kcenon::pacs::integration::identifier_does_not_match, kcenon::pacs::integration::partial_success, kcenon::pacs::integration::refused_move_destination_unknown, kcenon::pacs::integration::refused_out_of_resources, kcenon::pacs::integration::success, kcenon::pacs::integration::unable_to_process, and kcenon::pacs::integration::unknown_error.
Referenced by log_c_move_executed().

|
staticnodiscardprivate |
Definition at line 527 of file logger_adapter.cpp.
References kcenon::pacs::integration::image, kcenon::pacs::integration::patient, kcenon::pacs::integration::series, and kcenon::pacs::integration::study.
Referenced by log_c_find_executed().

|
staticnodiscardprivate |
Definition at line 542 of file logger_adapter.cpp.
References kcenon::pacs::integration::access_denied, kcenon::pacs::integration::association_rejected, kcenon::pacs::integration::authentication_failure, kcenon::pacs::integration::authentication_success, kcenon::pacs::integration::configuration_change, kcenon::pacs::integration::data_export, and kcenon::pacs::integration::invalid_request.
Referenced by log_security_event().

|
static |
Set the minimum log level.
| level | New minimum log level |
Definition at line 343 of file logger_adapter.cpp.
|
static |
Shutdown the logger.
Flushes all pending messages and releases resources. Should be called before application exit.
Definition at line 338 of file logger_adapter.cpp.
|
staticnodiscardprivate |
Definition at line 483 of file logger_adapter.cpp.
References kcenon::pacs::integration::cannot_understand, kcenon::pacs::integration::dataset_error, kcenon::pacs::integration::duplicate_rejected, kcenon::pacs::integration::duplicate_stored, kcenon::pacs::integration::out_of_resources, kcenon::pacs::integration::processing_failure, kcenon::pacs::integration::success, and kcenon::pacs::integration::unknown_error.
Referenced by log_c_store_received().

|
inlinestatic |
Log a trace-level message.
| Args | Format argument types |
| fmt | Format string (std::format syntax) |
| args | Format arguments |
Definition at line 226 of file logger_adapter.h.
References log(), and kcenon::pacs::integration::trace.

|
inlinestatic |
Log a warning-level message.
| Args | Format argument types |
| fmt | Format string (std::format syntax) |
| args | Format arguments |
Definition at line 259 of file logger_adapter.h.
References log(), and kcenon::pacs::integration::warn.
Referenced by kcenon::pacs::workflow::task_scheduler::create_archive_callback(), kcenon::pacs::workflow::task_scheduler::create_cleanup_callback(), kcenon::pacs::workflow::task_scheduler::create_verification_callback(), kcenon::pacs::workflow::task_scheduler::deserialize_tasks(), kcenon::pacs::workflow::task_scheduler::execute_task(), and ai_service_connector::impl::initialize().


|
staticprivate |
Definition at line 351 of file logger_adapter.cpp.
Referenced by log_association_established(), log_association_released(), log_c_find_executed(), log_c_move_executed(), log_c_store_received(), and log_security_event().

|
staticprivate |
Definition at line 430 of file logger_adapter.h.